Skip to content

Conversation

@rumanstheddy
Copy link

No description provided.

@rumanstheddy rumanstheddy changed the title Implement game logic for math quiz Finished Math Game Jan 12, 2026
Copy link
Owner

@TheCSharpAcademy TheCSharpAcademy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rumanstheddy Thanks for submitting! The project is looking good but there a couple of things I need you to address before I can approve. These aren't requirements but they'll be a good learning opportunity for you:

1️⃣The game is very limited if you're hard coding the questions. You can easily generate Random questions in C#.

image

2️⃣At the moment there's no input validation, so if I input something wrong the app crashes. Don't use recursion, use a loop for the validation.

image

3️⃣Your ShowMenu() calls StartGame(). StartGame() calls ShowMenu(). That's an endless recursion that means that each time a method is called it stays in the stack, occupying a little extra memory. While this is not a big issue in a small app, a few more methods and collections would quickly add up to a stack overflow. For that reason recursion isn't good practice in most cases.

Could you please fix these before I can approve? 😀Let me know if you have questions.

@rumanstheddy
Copy link
Author

rumanstheddy commented Jan 19, 2026

Thank you so much for taking the time to review these changes!
I will fix them and let you know.

@TheCSharpAcademy TheCSharpAcademy self-assigned this Jan 19, 2026
@rumanstheddy
Copy link
Author

rumanstheddy commented Jan 23, 2026

@TheCSharpAcademy, I have implemented the fixes you suggested.
Please take a look at them and let me know what you think, once you find the time.
Thank you so much!

Copy link
Owner

@TheCSharpAcademy TheCSharpAcademy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rumanstheddy Thanks for making the changes! There's still one problem. The divisions are crashing sometimes. Try playing the division game a few times and see if your app stops like this:


Image


I suspect there's something wrong with the ranges of your division when a = 1 or a = 2.


Image

@rumanstheddy
Copy link
Author

@TheCSharpAcademy Thank you so much for reviewing the code again!
I have fixed the issue, now 'a' will always be divisible by 'b'.

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