Skip to content

MathGame console application - #753

Closed
ivangar wants to merge 11 commits into
the-csharp-academy:mainfrom
ivangar:main
Closed

MathGame console application#753
ivangar wants to merge 11 commits into
the-csharp-academy:mainfrom
ivangar:main

Conversation

@ivangar

@ivangar ivangar commented Aug 24, 2026

Copy link
Copy Markdown

This PR adds the initial MathGame console application and project solution to the repository.

What’s included

• Solution and project files for MathGame.ivangar targeting .NET 10
• Core gameplay implementation (GameCenter.cs) and program entry point
• Game and Menu options with validations

How to test

  1. Open the solution MathGame.ivangar.slnx in Visual Studio
  2. Build the solution targeting .NET 10
  3. Run the console app and exercise the main game flow

@github-actions

Copy link
Copy Markdown

🚀 Project Submitted!

Thanks for submitting your project! I will review it soon.

📋 Please check the dashboard to make sure the project is marked as Pending.

⚠️ If it's not marked as pending, submit it manually using the URL for this PR.

@ivangar ivangar changed the title Initial commit — MathGame console application MathGame console application Aug 24, 2026
@TheCSharpAcademy

Copy link
Copy Markdown
Collaborator

@ivangar Project approved! 😄✅ The code is neatly organized and with very good separation of concerns. 👏👏It's a shame you didn't complete the challenges this time. 😟 It's always a good use of your time. But nothing stops you from revisiting the project later.

🥋Don't forget you need to submit the Freecodecamp certificate to earn your Green Belt.👏

👩‍🏫Feedback

🔍️The biggest one is IsPrimeNumber(). You don't actually need prime-number detection for GetDivisor(). This already works for prime numbers:

var divisors = Enumerable
    .Range(1, _op1)
    .Where(x => _op1 % x == 0)
    .ToList();

For a prime number, that simply produces 1 and the number itself. Removing IsPrimeNumber() would therefore simplify the code without losing functionality.

🔍️Also, GameValidator.ValidateAnswer(..., ref int score) makes the validator responsible for modifying game state. A cleaner design would be for validation to return whether the answer is correct and let Game update _score

🔍IGame doesn't provide much value at the moment because there's only one implementation and GameCenter directly creates new Game(). There's nothing wrong with practicing interfaces, but avoid introducing abstractions purely for their own sake. If another game implementation or dependency injection appears later, the interface becomes much more useful.

🗺️ Suggested next step

I noticed that you haven't completed any of our courses yet. I suggest you try our Intro to Object Oriented Programming course next. This will close gaps in your knowledge and give you more confidence about OOP.


☕If you like our roadmap, please consider buying us a coffee. We appreciate your help 🙂

Overall good work!✋🏻Looking forward to seeing your next projects!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants