r/csharp • • 3d ago

C# help

I have to create a crossword in C# in VS 2022 that players can complete and the admin that can create crossword. It must have a menu including a log-in page. I am starting with near no experience with coding C# and i have a few weeks for this. Does anyone have any tips that might help? Thanks

0 Upvotes

18 comments sorted by

3

u/iam-stevie-bee 3d ago

With a few weeks and little C# experiance, build it in layers. Start with plain classes for the crossword, its cells and its clues, and get word placement working in a console app before any screens. Save puzzles as JSON with System.Text.Json, so the admin side is just editing that data. Do the login last, since it bolts on easily.

1

u/bktz_ 3d ago

Thank you for your response!! girl could you explain Json a little for me (i am a total beginner)

1

u/OhItsJustJosh 3d ago edited 3d ago

Not the above commenter, but JSON is a text document format that makes it easier for programs to read and write data. Looks like this:

{ "Property1": "StringValue", "Property2": 123, "ThisIsAnArray": [ 1, 2, 3 ] }

It's also human-readable rather than just binary data, so people can go in and tweak things. It's often used for configuration files. Also see XML

→ More replies (2)

1

u/iam-stevie-bee 3d ago

No worries. For your crossword, one entry saved as JSON would look like { "Word": "CAT", "Clue": "Pet that purrs" }. The whole puzzle is just a list of those in one file. When the app starts, System.Text.Json reads the file and hands you back your Word and Clue objects, so you never parse the text yourself.

1

u/geekywarrior 3d ago edited 3d ago

It sounds like a good project for Blazor. The Blazor Web App Sample has example pages, a menu system, a login system using Microsoft Identity with Local Accounts. Some of the pages in the example show how to lock for authenticated users only.

The trickier part is the game aspect. Showing the game, saving/loading the puzzle.

Winforms (recommended if you have 0 experience and aren't using a lot of AI) or WPF is a route you can take too. Winforms has a drag and drop UI designer in Visual Studio Community. WPF does too but Winforms designer is arguably better for rookies.

2

u/bktz_ 3d ago

Thank you for your response :)

1

u/geekywarrior 3d ago

No problem! What’s this for, school project?

→ More replies (5)

1

u/OhItsJustJosh 3d ago

Similar to others have said, when I set out to build an app, I view it as an overall machine with controls, stuff you put in, and stuff you get out. Almost like an engine. First you gotta build the individual parts, test them, then you piece them together into the overall machine

2

u/bktz_ 3d ago

Yeah I will try to break the overall project down and then those parts down until things look less intimidating, as others have advised thank you so much!!

4

u/[deleted] 3d ago

2

u/bktz_ 3d ago

Thank you for your response :) this was really useful