My implementation of the MathGame project.#723
Conversation
There was a problem hiding this comment.
@BudgetKratos Thanks for submitting! There's a bug blocking in the history, which blocks the approval, could you please check?
When the player chooses not to play again, Operate() calls Menu() before reaching ScoreCard.Add(...). Consequently, the completed result is not added to the score history until the nested menu eventually returns. Repeated navigation also creates an unnecessary chain of recursive method calls.
Instead of calling Menu() from inside Operate(), let Operate() finish naturally:
if (!retry)
{
ScoreCard.Add($"{CurrentDifficulty} {actualOperation} {score}");
DisplayMessage("Press any key to go back to the previous menu.", displayColor);
Console.ReadKey();
return;
}
Upon fixing, just commit your changes, no need for a new PR 😁
|
Good catch, thank you ^_^ I've also slightly updated the code so that every retry counts as a separate attempt (as I had originally intended). |
I took the advice below a bit too literally, this was my third attempt at the Math Game.
I'm sure if I were left to my own devices, I would still be obsessing over the tiny details, trying to make everything perfect.
It's a habit I should kick or, at the very least, channel into something else!