From 79ea11b164b255139782c667004a9df0e22c078a Mon Sep 17 00:00:00 2001 From: Jakub768 Date: Tue, 28 Jul 2026 12:12:33 +0100 Subject: [PATCH 1/9] Start user interaction --- CodeReviews.Console.MathGame.csproj | 10 ++++++++++ Menu.cs | 6 ++++++ Operation.cs | 7 +++++++ Program.cs | 8 ++++++++ UserGameInteract.cs | 24 ++++++++++++++++++++++++ 5 files changed, 55 insertions(+) create mode 100644 CodeReviews.Console.MathGame.csproj create mode 100644 Menu.cs create mode 100644 Operation.cs create mode 100644 Program.cs create mode 100644 UserGameInteract.cs diff --git a/CodeReviews.Console.MathGame.csproj b/CodeReviews.Console.MathGame.csproj new file mode 100644 index 00000000..2150e379 --- /dev/null +++ b/CodeReviews.Console.MathGame.csproj @@ -0,0 +1,10 @@ + + + + Exe + net8.0 + enable + enable + + + diff --git a/Menu.cs b/Menu.cs new file mode 100644 index 00000000..5fb35827 --- /dev/null +++ b/Menu.cs @@ -0,0 +1,6 @@ +public enum Menu +{ + History, + Play, + Exit +}; \ No newline at end of file diff --git a/Operation.cs b/Operation.cs new file mode 100644 index 00000000..08a9d7d5 --- /dev/null +++ b/Operation.cs @@ -0,0 +1,7 @@ +public enum Operation +{ + Addition, + Subtraction, + Multiplication, + Division +} \ No newline at end of file diff --git a/Program.cs b/Program.cs new file mode 100644 index 00000000..820d9e33 --- /dev/null +++ b/Program.cs @@ -0,0 +1,8 @@ +public class Program +{ + public static void Main(String[] args) + { + UserGameInteract user = new UserGameInteract(); + user.PromptMenu(); + } +} \ No newline at end of file diff --git a/UserGameInteract.cs b/UserGameInteract.cs new file mode 100644 index 00000000..82463b44 --- /dev/null +++ b/UserGameInteract.cs @@ -0,0 +1,24 @@ +public class UserGameInteract +{ + public Menu PromptMenu() + { + Console.WriteLine("Welcome to Math quiz game! Please enter the choice:"); + + for(int i = 0; i < Enum.GetNames(typeof(Menu)).Length; i++) + { + Console.WriteLine($"{i}: {Enum.GetName(typeof(Menu), i)}"); + } + } + + public Operation PromptOperation() + { + Console.WriteLine("Please enter which operation you would like to have: "); + + for (int i = 0; i < Enum.GetNames(typeof(Operation)).Length; i++) + { + Console.WriteLine($"{i}: {Enum.GetName(typeof(Operation), i)}"); + } + } + + +} \ No newline at end of file From a09d6d79a546742e63cc0bf0bc5480caf0e40436 Mon Sep 17 00:00:00 2001 From: Jakub768 Date: Tue, 28 Jul 2026 13:02:20 +0100 Subject: [PATCH 2/9] implement operations class --- BaseOperation.cs | 39 +++++++++++++++++++++++++++++++++++++++ HandleUserChoice.cs | 13 +++++++++++++ MathQuizApp.cs | 7 +++++++ Program.cs | 4 ++-- UserGameInteract.cs | 6 ++++++ handleGame.cs | 3 +++ 6 files changed, 70 insertions(+), 2 deletions(-) create mode 100644 BaseOperation.cs create mode 100644 HandleUserChoice.cs create mode 100644 MathQuizApp.cs create mode 100644 handleGame.cs diff --git a/BaseOperation.cs b/BaseOperation.cs new file mode 100644 index 00000000..04dc543d --- /dev/null +++ b/BaseOperation.cs @@ -0,0 +1,39 @@ +public abstract class BaseOperation +{ + private static readonly Random _Random = new Random(); + public int firstNumber {get;} + public int secondNumber {get;} + public abstract int result { get; } + public abstract string operatorSymbol { get; } + + public BaseOperation() + { + firstNumber = _Random.Next(1,11); + secondNumber = _Random.Next(1,11); + } + +} + +public class AdditionOperation : BaseOperation +{ + public override string operatorSymbol => "+"; + public override int result => firstNumber + secondNumber; +} + +public class SubtractionOperation : BaseOperation +{ + public override string operatorSymbol => "-"; + public override int result => firstNumber - secondNumber; +} + +public class MultiplicationOperation : BaseOperation +{ + public override string operatorSymbol => "*"; + public override int result => firstNumber * secondNumber; +} + +public class DivisionOperation : BaseOperation +{ + public override string operatorSymbol => "/"; + public override int result => firstNumber / secondNumber; +} \ No newline at end of file diff --git a/HandleUserChoice.cs b/HandleUserChoice.cs new file mode 100644 index 00000000..62c88509 --- /dev/null +++ b/HandleUserChoice.cs @@ -0,0 +1,13 @@ +public class HandleUserChoice +{ + public void displayHistory() + { + // display history of games from class GameHistory + } + + public void handleGame() + { + //init game stuff (generate questions based on operation) + // display questions + } +} \ No newline at end of file diff --git a/MathQuizApp.cs b/MathQuizApp.cs new file mode 100644 index 00000000..b26742dd --- /dev/null +++ b/MathQuizApp.cs @@ -0,0 +1,7 @@ +public class MathQuizApp +{ + public void Run() + { + + } +} \ No newline at end of file diff --git a/Program.cs b/Program.cs index 820d9e33..ed4d7f29 100644 --- a/Program.cs +++ b/Program.cs @@ -2,7 +2,7 @@ { public static void Main(String[] args) { - UserGameInteract user = new UserGameInteract(); - user.PromptMenu(); + handleGame n = new handleGame(); + n.generatenums(); } } \ No newline at end of file diff --git a/UserGameInteract.cs b/UserGameInteract.cs index 82463b44..1ddfee89 100644 --- a/UserGameInteract.cs +++ b/UserGameInteract.cs @@ -8,6 +8,9 @@ public Menu PromptMenu() { Console.WriteLine($"{i}: {Enum.GetName(typeof(Menu), i)}"); } + + int menuChoice = int.Parse(Console.ReadLine()); + return (Menu)menuChoice; } public Operation PromptOperation() @@ -18,6 +21,9 @@ public Operation PromptOperation() { Console.WriteLine($"{i}: {Enum.GetName(typeof(Operation), i)}"); } + + int operationChoice = int.Parse(Console.ReadLine()); + return (Operation)operationChoice; } diff --git a/handleGame.cs b/handleGame.cs new file mode 100644 index 00000000..8246fa10 --- /dev/null +++ b/handleGame.cs @@ -0,0 +1,3 @@ +public class handleGame +{ +} \ No newline at end of file From cdc25da2818eb7f19079c326d0c8ac1e70ba2687 Mon Sep 17 00:00:00 2001 From: Jakub768 Date: Tue, 28 Jul 2026 13:33:24 +0100 Subject: [PATCH 3/9] implement question generator --- GameHistory.cs | 8 ++++++++ Program.cs | 9 +++++++-- QuestionGenerator.cs | 25 +++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 GameHistory.cs create mode 100644 QuestionGenerator.cs diff --git a/GameHistory.cs b/GameHistory.cs new file mode 100644 index 00000000..daf5f44f --- /dev/null +++ b/GameHistory.cs @@ -0,0 +1,8 @@ +public class GameHistory +{ + + public List getGameHistory() + { + return null; + } +} \ No newline at end of file diff --git a/Program.cs b/Program.cs index ed4d7f29..f5391385 100644 --- a/Program.cs +++ b/Program.cs @@ -2,7 +2,12 @@ { public static void Main(String[] args) { - handleGame n = new handleGame(); - n.generatenums(); + QuestionGenerator gen = new QuestionGenerator(); + var qst = gen.GenerateQuestions(Operation.Addition); + + foreach (var q in qst) + { + Console.WriteLine($"{q.firstNumber} {q.secondNumber} {q.result}"); + } } } \ No newline at end of file diff --git a/QuestionGenerator.cs b/QuestionGenerator.cs new file mode 100644 index 00000000..6bc59c09 --- /dev/null +++ b/QuestionGenerator.cs @@ -0,0 +1,25 @@ +public class QuestionGenerator +{ + private static readonly Dictionary> operation = new Dictionary>() + { + [Operation.Addition] = () => new AdditionOperation(), + [Operation.Subtraction] = () => new SubtractionOperation(), + [Operation.Multiplication] = () => new MultiplicationOperation(), + [Operation.Division] = () => new DivisionOperation(), + }; + public List GenerateQuestions(Operation chosenOp) + { + if (!operation.TryGetValue(chosenOp, out var createOperation)) + { + throw new Exception("specified function is not there"); + } + + List questions = new List(); + for (int i = 0; i < 5; i++) + { + questions.Add(createOperation()); + } + + return questions; + } +} \ No newline at end of file From e8c84e600f77ed915f77631853252e44a8db0550 Mon Sep 17 00:00:00 2001 From: Jakub768 Date: Tue, 28 Jul 2026 15:41:38 +0100 Subject: [PATCH 4/9] implement game quiz --- HandleUserChoice.cs | 14 +++++++++++--- MathQuizApp.cs | 25 ++++++++++++++++++++++++- Program.cs | 6 ------ handleGame.cs | 30 +++++++++++++++++++++++++++++- 4 files changed, 64 insertions(+), 11 deletions(-) diff --git a/HandleUserChoice.cs b/HandleUserChoice.cs index 62c88509..e20f6ad9 100644 --- a/HandleUserChoice.cs +++ b/HandleUserChoice.cs @@ -1,13 +1,21 @@ public class HandleUserChoice { + QuestionGenerator _questionGenerator; + HandleGame _gameHandler; + + public HandleUserChoice(QuestionGenerator questionGenerator, HandleGame gameHandler) + { + _questionGenerator = questionGenerator; + _gameHandler = gameHandler; + } public void displayHistory() { // display history of games from class GameHistory } - public void handleGame() + public void initGame(Operation op) { - //init game stuff (generate questions based on operation) - // display questions + List questions = _questionGenerator.GenerateQuestions(op); + _gameHandler.Play(questions); } } \ No newline at end of file diff --git a/MathQuizApp.cs b/MathQuizApp.cs index b26742dd..bf561bce 100644 --- a/MathQuizApp.cs +++ b/MathQuizApp.cs @@ -1,7 +1,30 @@ public class MathQuizApp { + public UserGameInteract _interact; + + public MathQuizApp(UserGameInteract interact) + { + _interact = interact; + } + public void Run() { - + UserGameInteract interact = new UserGameInteract(); + Operation chosenOp; + + Menu m = interact.PromptMenu(); + + switch (m) + { + case Menu.History: + Console.WriteLine("no"); + break; + case Menu.Play: + chosenOp = interact.PromptOperation(); + break; + case Menu.Exit: + Environment.Exit(1); + break; + } } } \ No newline at end of file diff --git a/Program.cs b/Program.cs index f5391385..5e876b30 100644 --- a/Program.cs +++ b/Program.cs @@ -2,12 +2,6 @@ { public static void Main(String[] args) { - QuestionGenerator gen = new QuestionGenerator(); - var qst = gen.GenerateQuestions(Operation.Addition); - foreach (var q in qst) - { - Console.WriteLine($"{q.firstNumber} {q.secondNumber} {q.result}"); - } } } \ No newline at end of file diff --git a/handleGame.cs b/handleGame.cs index 8246fa10..dc22120e 100644 --- a/handleGame.cs +++ b/handleGame.cs @@ -1,3 +1,31 @@ -public class handleGame + +using System.Formats.Asn1; + +public class HandleGame { + private const int QUESTION_AMOUNT = 5; + public void Play(List questions) + { + int rounds = 0; + + while (rounds < QUESTION_AMOUNT) + { + Console.WriteLine($"{questions[rounds].firstNumber} {questions[rounds].operatorSymbol} {questions[rounds].secondNumber}"); + + if (!int.TryParse(Console.ReadLine(), out int answer)) + { + Console.WriteLine("Invalid input, please enter your answer as a number"); + } + + if (answer == questions[rounds].result) + { + Console.WriteLine("correct you get a point!"); + } + else + { + Console.WriteLine("Incorrect, you do not get a point."); + } + + } + } } \ No newline at end of file From e0defb72be353b7b3869ddc9508e5a08ee0bbe91 Mon Sep 17 00:00:00 2001 From: Jakub768 Date: Tue, 28 Jul 2026 15:48:39 +0100 Subject: [PATCH 5/9] run the app! --- MathQuizApp.cs | 5 ++++- Program.cs | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/MathQuizApp.cs b/MathQuizApp.cs index bf561bce..321f1482 100644 --- a/MathQuizApp.cs +++ b/MathQuizApp.cs @@ -1,10 +1,12 @@ public class MathQuizApp { public UserGameInteract _interact; + public HandleUserChoice _choiceHandler; - public MathQuizApp(UserGameInteract interact) + public MathQuizApp(UserGameInteract interact, HandleUserChoice choiceHandler) { _interact = interact; + _choiceHandler = choiceHandler; } public void Run() @@ -21,6 +23,7 @@ public void Run() break; case Menu.Play: chosenOp = interact.PromptOperation(); + _choiceHandler.initGame(chosenOp); break; case Menu.Exit: Environment.Exit(1); diff --git a/Program.cs b/Program.cs index 5e876b30..e6897901 100644 --- a/Program.cs +++ b/Program.cs @@ -2,6 +2,10 @@ { public static void Main(String[] args) { - + MathQuizApp App = new MathQuizApp(new UserGameInteract(), + new HandleUserChoice( + new QuestionGenerator(), + new HandleGame())); + App.Run(); } } \ No newline at end of file From fde6f5e22b529a534e0202da522ab64407ad3650 Mon Sep 17 00:00:00 2001 From: Jakub768 Date: Tue, 28 Jul 2026 15:59:51 +0100 Subject: [PATCH 6/9] implement score handler, fix some mistakes. --- Program.cs | 3 ++- ScoreHandler.cs | 9 +++++++++ handleGame.cs | 10 ++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 ScoreHandler.cs diff --git a/Program.cs b/Program.cs index e6897901..9d2f7298 100644 --- a/Program.cs +++ b/Program.cs @@ -5,7 +5,8 @@ public static void Main(String[] args) MathQuizApp App = new MathQuizApp(new UserGameInteract(), new HandleUserChoice( new QuestionGenerator(), - new HandleGame())); + new HandleGame( + new ScoreHandler()))); App.Run(); } } \ No newline at end of file diff --git a/ScoreHandler.cs b/ScoreHandler.cs new file mode 100644 index 00000000..7e3e5533 --- /dev/null +++ b/ScoreHandler.cs @@ -0,0 +1,9 @@ +public interface IScoreManager +{ + int score {get; set;} +} + +public class ScoreHandler : IScoreManager +{ + public int score { get; set;} +} \ No newline at end of file diff --git a/handleGame.cs b/handleGame.cs index dc22120e..056edd3a 100644 --- a/handleGame.cs +++ b/handleGame.cs @@ -4,6 +4,12 @@ public class HandleGame { private const int QUESTION_AMOUNT = 5; + private IScoreManager _scoreHandler; + + public HandleGame(IScoreManager scoreHandler) + { + _scoreHandler = scoreHandler; + } public void Play(List questions) { int rounds = 0; @@ -20,12 +26,16 @@ public void Play(List questions) if (answer == questions[rounds].result) { Console.WriteLine("correct you get a point!"); + _scoreHandler.score++; } else { Console.WriteLine("Incorrect, you do not get a point."); } + rounds++; } + + Console.WriteLine($"That's the end of the game! you scored: {_scoreHandler.score}"); } } \ No newline at end of file From b72978d6671b8202bb4d7e7fa1e8a54b4314a354 Mon Sep 17 00:00:00 2001 From: Jakub768 Date: Tue, 28 Jul 2026 16:07:36 +0100 Subject: [PATCH 7/9] fix unnecessary instantiation --- MathQuizApp.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/MathQuizApp.cs b/MathQuizApp.cs index 321f1482..d54592cd 100644 --- a/MathQuizApp.cs +++ b/MathQuizApp.cs @@ -11,18 +11,16 @@ public MathQuizApp(UserGameInteract interact, HandleUserChoice choiceHandler) public void Run() { - UserGameInteract interact = new UserGameInteract(); Operation chosenOp; - Menu m = interact.PromptMenu(); - + Menu m = _interact.PromptMenu(); switch (m) { case Menu.History: Console.WriteLine("no"); break; case Menu.Play: - chosenOp = interact.PromptOperation(); + chosenOp = _interact.PromptOperation(); _choiceHandler.initGame(chosenOp); break; case Menu.Exit: From b254134241ae5d5df1706ed4c86e0d7e4c6cf94c Mon Sep 17 00:00:00 2001 From: Jakub768 Date: Tue, 28 Jul 2026 22:18:22 +0100 Subject: [PATCH 8/9] implement game history --- GameHistory.cs | 8 ++++++-- MathQuizApp.cs | 28 ++++++++++++++++------------ Program.cs | 3 ++- QuestionGenerator.cs | 8 ++++++++ 4 files changed, 32 insertions(+), 15 deletions(-) diff --git a/GameHistory.cs b/GameHistory.cs index daf5f44f..cb3e1443 100644 --- a/GameHistory.cs +++ b/GameHistory.cs @@ -1,8 +1,12 @@ public class GameHistory { + public static List? savedQuestions { get; set; } - public List getGameHistory() + public void SaveQuestions(List Questions) { - return null; + foreach (var q in Questions) + { + savedQuestions?.Add(q); + } } } \ No newline at end of file diff --git a/MathQuizApp.cs b/MathQuizApp.cs index d54592cd..8611ae77 100644 --- a/MathQuizApp.cs +++ b/MathQuizApp.cs @@ -12,20 +12,24 @@ public MathQuizApp(UserGameInteract interact, HandleUserChoice choiceHandler) public void Run() { Operation chosenOp; + bool endApp = false; - Menu m = _interact.PromptMenu(); - switch (m) + while (!endApp) { - case Menu.History: - Console.WriteLine("no"); - break; - case Menu.Play: - chosenOp = _interact.PromptOperation(); - _choiceHandler.initGame(chosenOp); - break; - case Menu.Exit: - Environment.Exit(1); - break; + Menu m = _interact.PromptMenu(); + switch (m) + { + case Menu.History: + Console.WriteLine("no"); + break; + case Menu.Play: + chosenOp = _interact.PromptOperation(); + _choiceHandler.initGame(chosenOp); + break; + case Menu.Exit: + endApp = true; + break; + } } } } \ No newline at end of file diff --git a/Program.cs b/Program.cs index 9d2f7298..9d4f5b1d 100644 --- a/Program.cs +++ b/Program.cs @@ -4,7 +4,8 @@ public static void Main(String[] args) { MathQuizApp App = new MathQuizApp(new UserGameInteract(), new HandleUserChoice( - new QuestionGenerator(), + new QuestionGenerator( + new GameHistory()), new HandleGame( new ScoreHandler()))); App.Run(); diff --git a/QuestionGenerator.cs b/QuestionGenerator.cs index 6bc59c09..133bb43c 100644 --- a/QuestionGenerator.cs +++ b/QuestionGenerator.cs @@ -1,5 +1,11 @@ public class QuestionGenerator { + private GameHistory _questionHistory; + + public QuestionGenerator(GameHistory questionHistory) + { + _questionHistory = questionHistory; + } private static readonly Dictionary> operation = new Dictionary>() { [Operation.Addition] = () => new AdditionOperation(), @@ -20,6 +26,8 @@ public List GenerateQuestions(Operation chosenOp) questions.Add(createOperation()); } + _questionHistory.SaveQuestions(questions); + return questions; } } \ No newline at end of file From a0c49566141fe5f40f8e31e68856a0f334e4c365 Mon Sep 17 00:00:00 2001 From: Jakub768 Date: Thu, 30 Jul 2026 20:25:28 +0100 Subject: [PATCH 9/9] fix division --- BaseOperation.cs | 17 +++++++++++++---- GameHistory.cs | 19 ++++++++++++++++--- HandleUserChoice.cs | 6 ++++-- MathQuizApp.cs | 2 +- Program.cs | 8 ++++++-- QuestionGenerator.cs | 4 ++-- UserGameInteract.cs | 1 + 7 files changed, 43 insertions(+), 14 deletions(-) diff --git a/BaseOperation.cs b/BaseOperation.cs index 04dc543d..e46de18d 100644 --- a/BaseOperation.cs +++ b/BaseOperation.cs @@ -1,8 +1,8 @@ public abstract class BaseOperation { - private static readonly Random _Random = new Random(); - public int firstNumber {get;} - public int secondNumber {get;} + protected static readonly Random _Random = new Random(); + public int firstNumber {get; protected set;} + public int secondNumber {get; protected set;} public abstract int result { get; } public abstract string operatorSymbol { get; } @@ -34,6 +34,15 @@ public class MultiplicationOperation : BaseOperation public class DivisionOperation : BaseOperation { - public override string operatorSymbol => "/"; public override int result => firstNumber / secondNumber; + public override string operatorSymbol => "/"; + + public DivisionOperation() + { + secondNumber = _Random.Next(1,11); + int quotient = _Random.Next(1,11); + + firstNumber = secondNumber * quotient; + } + } \ No newline at end of file diff --git a/GameHistory.cs b/GameHistory.cs index cb3e1443..8bca974c 100644 --- a/GameHistory.cs +++ b/GameHistory.cs @@ -1,12 +1,25 @@ -public class GameHistory + +public interface IGameHistory +{ + List savedQuestions { get; set; } + + void SaveQuestions(List Questions); +} + +public class GameHistory : IGameHistory { - public static List? savedQuestions { get; set; } + public List savedQuestions { get; set; } = new List(); public void SaveQuestions(List Questions) { foreach (var q in Questions) { - savedQuestions?.Add(q); + savedQuestions.Add(q); } } + + public override string ToString() + { + return string.Join("\n", savedQuestions.Select(qstn => $"{qstn.firstNumber} {qstn.operatorSymbol} {qstn.secondNumber} = {qstn.result}")); + } } \ No newline at end of file diff --git a/HandleUserChoice.cs b/HandleUserChoice.cs index e20f6ad9..efc86513 100644 --- a/HandleUserChoice.cs +++ b/HandleUserChoice.cs @@ -2,15 +2,17 @@ public class HandleUserChoice { QuestionGenerator _questionGenerator; HandleGame _gameHandler; + IGameHistory _gameHistory; - public HandleUserChoice(QuestionGenerator questionGenerator, HandleGame gameHandler) + public HandleUserChoice(QuestionGenerator questionGenerator, HandleGame gameHandler, IGameHistory gamehistory) { _questionGenerator = questionGenerator; _gameHandler = gameHandler; + _gameHistory = gamehistory; } public void displayHistory() { - // display history of games from class GameHistory + Console.WriteLine(_gameHistory.ToString()); } public void initGame(Operation op) diff --git a/MathQuizApp.cs b/MathQuizApp.cs index 8611ae77..150f1e45 100644 --- a/MathQuizApp.cs +++ b/MathQuizApp.cs @@ -20,7 +20,7 @@ public void Run() switch (m) { case Menu.History: - Console.WriteLine("no"); + _choiceHandler.displayHistory(); break; case Menu.Play: chosenOp = _interact.PromptOperation(); diff --git a/Program.cs b/Program.cs index 9d4f5b1d..f2a260a9 100644 --- a/Program.cs +++ b/Program.cs @@ -2,12 +2,16 @@ { public static void Main(String[] args) { + + IGameHistory gameHistory = new GameHistory(); + MathQuizApp App = new MathQuizApp(new UserGameInteract(), new HandleUserChoice( new QuestionGenerator( - new GameHistory()), + gameHistory), new HandleGame( - new ScoreHandler()))); + new ScoreHandler()), + gameHistory)); App.Run(); } } \ No newline at end of file diff --git a/QuestionGenerator.cs b/QuestionGenerator.cs index 133bb43c..e3682257 100644 --- a/QuestionGenerator.cs +++ b/QuestionGenerator.cs @@ -1,8 +1,8 @@ public class QuestionGenerator { - private GameHistory _questionHistory; + private IGameHistory _questionHistory; - public QuestionGenerator(GameHistory questionHistory) + public QuestionGenerator(IGameHistory questionHistory) { _questionHistory = questionHistory; } diff --git a/UserGameInteract.cs b/UserGameInteract.cs index 1ddfee89..159708e5 100644 --- a/UserGameInteract.cs +++ b/UserGameInteract.cs @@ -9,6 +9,7 @@ public Menu PromptMenu() Console.WriteLine($"{i}: {Enum.GetName(typeof(Menu), i)}"); } + int menuChoice = int.Parse(Console.ReadLine()); return (Menu)menuChoice; }