forked from the-csharp-academy/CodeReviews.Console.MathGame
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUserGameInteract.cs
More file actions
30 lines (23 loc) · 822 Bytes
/
Copy pathUserGameInteract.cs
File metadata and controls
30 lines (23 loc) · 822 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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)}");
}
int menuChoice = int.Parse(Console.ReadLine());
return (Menu)menuChoice;
}
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)}");
}
int operationChoice = int.Parse(Console.ReadLine());
return (Operation)operationChoice;
}
}