Advertisement
Guest User

Untitled

a guest
May 24th, 2023
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 27.32 KB | None | 0 0
  1. using System;
  2. using System.Threading;
  3.  
  4. namespace MeksMathGame
  5. {
  6.     class Program
  7.     {
  8.  
  9.         static void EndGame()
  10.         {
  11.             Console.WriteLine("You've Answered All The Questions! Would You Like To Play Again? Y/N");
  12.  
  13.             string userOption = Console.ReadLine();
  14.  
  15.             if (userOption.ToLower() == "y")
  16.             {
  17.                 Console.WriteLine("You Selected To Play Again. Re-Launching Application!\n");
  18.                 Thread.Sleep(3000);
  19.                 DifficultySelection();
  20.             }
  21.             else
  22.             {
  23.                 Console.WriteLine("You Selected To Not Play Again. Closing Application!\n");
  24.                 Thread.Sleep(3000);
  25.             }
  26.         }
  27.  
  28.         static void CheckSolution(int num1, string operation, int num2, int userSolution, string gameType, string difficulty, int numOfQuestions)
  29.         {
  30.             switch (operation)
  31.             {
  32.                 case "+":
  33.                     if (userSolution == (num1 + num2))
  34.                     {
  35.                         Console.WriteLine("Great Job! Next Question!\n");
  36.                         Thread.Sleep(3000);
  37.  
  38.                         numOfQuestions--;
  39.  
  40.                         if (numOfQuestions == 0)
  41.                         {
  42.                             EndGame();
  43.                         }
  44.                         else
  45.                         {
  46.                             StartGame(gameType, difficulty, numOfQuestions);
  47.                         };
  48.                     }
  49.                     else
  50.                     {
  51.                         Console.WriteLine("Incorrect Answer! Next Question!\n");
  52.                         Thread.Sleep(3000);
  53.                         StartGame(gameType, difficulty, numOfQuestions - 1);
  54.                     };
  55.                     break;
  56.  
  57.                 case "-":
  58.                     if (userSolution == (num1 - num2) | userSolution == (num2 - num1))
  59.                     {
  60.                         Console.WriteLine("Great Job! Next Question!\n");
  61.                         Thread.Sleep(3000);
  62.                         StartGame(gameType, difficulty, numOfQuestions - 1);
  63.                     }
  64.                     else
  65.                     {
  66.                         Console.WriteLine("Incorrect Answer! Next Question!\n");
  67.                         Thread.Sleep(3000);
  68.                         StartGame(gameType, difficulty, numOfQuestions - 1);
  69.                     };
  70.                     break;
  71.  
  72.                 case "*":
  73.                     if (userSolution == (num1*num2))
  74.                     {
  75.                         Console.WriteLine("Great Job! Next Question!\n");
  76.                         Thread.Sleep(3000);
  77.                         StartGame(gameType, difficulty, numOfQuestions - 1);
  78.                     }
  79.                     else
  80.                     {
  81.                         Console.WriteLine("Incorrect Answer! Next Question!\n");
  82.                         Thread.Sleep(3000);
  83.                         StartGame(gameType, difficulty, numOfQuestions - 1);
  84.                     }
  85.                     break;
  86.  
  87.                 case "/":
  88.                     // if the users solution is equal to the solution as an integer or a double, then it's correct
  89.                     // this needs to be tweaked along with lines 323-400
  90.                     if (userSolution == (num2/num1) | userSolution == (num2/num1))
  91.                     {
  92.                         Console.WriteLine("Great Job! Next Question!\n");
  93.                         Thread.Sleep(3000);
  94.                         StartGame(gameType, difficulty, numOfQuestions - 1);
  95.                     }
  96.                     else
  97.                     {
  98.                         Console.WriteLine("Incorrect Answer! Next Question!\n");
  99.                         Thread.Sleep(3000);
  100.                         StartGame(gameType, difficulty, numOfQuestions - 1);
  101.                     }
  102.                     break;
  103.  
  104.                 default:
  105.                     Console.WriteLine("Invalid Operation On Checking Solution. Re-Running Program!\n");
  106.                     Thread.Sleep(6000);
  107.                     DifficultySelection();
  108.                     break;
  109.             }
  110.         }
  111.  
  112.         static void StartGame(string gameType, string difficulty, int numberOfQuestions)
  113.         {
  114.             Console.WriteLine("Game: " + gameType + "\nMode: " + difficulty.ToUpper());
  115.  
  116.             switch (gameType)
  117.             {
  118.                 case "addition":
  119.                     switch (difficulty)
  120.                     {
  121.                         case "easy":
  122.                             for (int i = 1; i < numberOfQuestions; i++)
  123.                             {
  124.                                 Random numberGenEasyAdd = new Random();
  125.  
  126.                                 int num1Eadd = numberGenEasyAdd.Next(0, 601);
  127.                                 int num2Eadd = numberGenEasyAdd.Next(0, 601);
  128.  
  129.                                 Console.WriteLine("What Is The Summation Of: " + num1Eadd + " + " + num2Eadd);
  130.  
  131.                                 int userSolutionEadd = Convert.ToInt32(Console.ReadLine());
  132.  
  133.                                 CheckSolution(num1Eadd, "+", num2Eadd, userSolutionEadd, gameType, difficulty, numberOfQuestions);
  134.                             };
  135.                             break;
  136.  
  137.                         case "medium":
  138.                             for (int i = 1; i < numberOfQuestions; i++)
  139.                             {
  140.                                 Random numberGenMediumAdd = new Random();
  141.  
  142.                                 int num1Madd = numberGenMediumAdd.Next(600, 1201);
  143.                                 int num2Madd = numberGenMediumAdd.Next(600, 1201);
  144.  
  145.                                 Console.WriteLine("What Is The Summation Of: " + num1Madd + " + " + num2Madd);
  146.  
  147.                                 int userSolutionMadd = Convert.ToInt32(Console.ReadLine());
  148.  
  149.                                 CheckSolution(num1Madd, "+", num2Madd, userSolutionMadd, gameType, difficulty, numberOfQuestions);
  150.                             };
  151.                             break;
  152.                        
  153.                         case "hard":
  154.                             for (int i = 1; i < numberOfQuestions; i++)
  155.                             {
  156.                                 Random numberGenHardAdd = new Random();
  157.  
  158.                                 int num1Hadd = numberGenHardAdd.Next(1200, 1801);
  159.                                 int num2Hadd = numberGenHardAdd.Next(1200, 1801);
  160.  
  161.                                 Console.WriteLine("What Is The Summation Of: " + num1Hadd + " + " + num2Hadd);
  162.  
  163.                                 int userSolutionHadd = Convert.ToInt32(Console.ReadLine());
  164.  
  165.                                 CheckSolution(num1Hadd, "+", num2Hadd, userSolutionHadd, gameType, difficulty, numberOfQuestions);
  166.                             };
  167.                             break;
  168.  
  169.                         case "expert":
  170.                             for (int i = 1; i < numberOfQuestions; i++)
  171.                             {
  172.                                 Random numberGenExpertAdd = new Random();
  173.  
  174.                                 int num1ExAdd = numberGenExpertAdd.Next(1800, 2401);
  175.                                 int num2ExAdd = numberGenExpertAdd.Next(1800, 2401);
  176.  
  177.                                 Console.WriteLine("What Is The Summation Of: " + num1ExAdd + " + " + num2ExAdd);
  178.  
  179.                                 int userSolutionExAdd = Convert.ToInt32(Console.ReadLine());
  180.  
  181.                                 CheckSolution(num1ExAdd, "+", num2ExAdd, userSolutionExAdd, gameType, difficulty, numberOfQuestions);
  182.                             };
  183.                             break;
  184.  
  185.                         case "master":
  186.                             for (int i = 1; i < numberOfQuestions; i++)
  187.                             {
  188.                                 Random numberGenMaAdd = new Random();
  189.  
  190.                                 int num1MaAdd = numberGenMaAdd.Next(2400, 3001);
  191.                                 int num2MaAdd = numberGenMaAdd.Next(2400, 3001);
  192.  
  193.                                 Console.WriteLine("What Is The Summation Of: " + num1MaAdd + " + " + num2MaAdd);
  194.  
  195.                                 int userSolutionMaAdd = Convert.ToInt32(Console.ReadLine());
  196.  
  197.                                 CheckSolution(num1MaAdd, "+", num2MaAdd, userSolutionMaAdd, gameType, difficulty, numberOfQuestions);
  198.                             };
  199.                             break;
  200.  
  201.                         default:
  202.                             Console.WriteLine("Invalid Operation On Addition Game. Re-Running Program!\n");
  203.                             Thread.Sleep(6000);
  204.                             DifficultySelection();
  205.                             break;
  206.                     };
  207.                     break;
  208.  
  209.                 case "subtraction":
  210.                     switch (difficulty)
  211.                     {
  212.                         case "easy":
  213.                             for (int i = 1; i < numberOfQuestions; i++)
  214.                             {
  215.                                 Random numberGenEsub = new Random();
  216.  
  217.                                 int num1Esub = numberGenEsub.Next(0, 601);
  218.                                 int num2Esub = numberGenEsub.Next(0, 601);
  219.  
  220.                                 Console.WriteLine("What Is The Difference Between: " + num1Esub + " - " + num2Esub);
  221.  
  222.                                 int userSolutionEsub = Convert.ToInt32(Console.ReadLine());
  223.  
  224.                                 CheckSolution(num1Esub, "-", num2Esub, userSolutionEsub, gameType, difficulty, numberOfQuestions);
  225.                             };
  226.                             break;
  227.  
  228.                         case "medium":
  229.                             for (int i = 1; i < numberOfQuestions; i++)
  230.                             {
  231.                                 Random numberGenMsub = new Random();
  232.  
  233.                                 int num1Msub = numberGenMsub.Next(600, 1201);
  234.                                 int num2Msub = numberGenMsub.Next(600, 1201);
  235.  
  236.                                 Console.WriteLine("What is The Difference Between: " + num1Msub + " - " + num2Msub);
  237.  
  238.                                 int userSolutionMsub = Convert.ToInt32(Console.ReadLine());
  239.  
  240.                                 CheckSolution(num1Msub, "-", num2Msub, userSolutionMsub, gameType, difficulty, numberOfQuestions);
  241.                             };
  242.                             break;
  243.  
  244.                         case "hard":
  245.                             for (int i = 1; i < numberOfQuestions; i++)
  246.                             {
  247.                                 Random numberGenHsub = new Random();
  248.  
  249.                                 int num1Hsub = numberGenHsub.Next(1200, 1801);
  250.                                 int num2Hsub = numberGenHsub.Next(1200, 1801);
  251.  
  252.                                 Console.WriteLine("What Is The Difference Between: " + num1Hsub + " - " + num2Hsub);
  253.  
  254.                                 int userSolutionHsub = Convert.ToInt32(Console.ReadLine());
  255.  
  256.                                 CheckSolution(num1Hsub, "-", num2Hsub, userSolutionHsub, gameType, difficulty, numberOfQuestions);
  257.                             };
  258.                             break;
  259.  
  260.                         case "expert":
  261.                             for (int i = 1; i < numberOfQuestions; i++)
  262.                             {
  263.                                 Random numberGenExSub = new Random();
  264.  
  265.                                 int num1ExSub = numberGenExSub.Next(1800, 2401);
  266.                                 int num2ExSub = numberGenExSub.Next(1800, 2401);
  267.  
  268.                                 Console.WriteLine("What Is The Difference Between: " + num1ExSub + " - " + num2ExSub);
  269.  
  270.                                 int userSolutionExSub = Convert.ToInt32(Console.ReadLine());
  271.  
  272.                                 CheckSolution(num1ExSub, "-", num2ExSub, userSolutionExSub, gameType, difficulty, numberOfQuestions);
  273.                             };
  274.                             break;
  275.  
  276.                         case "master":
  277.                             for (int i = 1; i < numberOfQuestions; i++)
  278.                             {
  279.                                 Random numberGenMaSub = new Random();
  280.  
  281.                                 int num1MaSub = numberGenMaSub.Next(2400, 3001);
  282.                                 int num2MaSub = numberGenMaSub.Next(2400, 3001);
  283.  
  284.                                 Console.WriteLine("What Is The Difference Between: " + num1MaSub + " - " + num2MaSub);
  285.  
  286.                                 int userSolutionMaSub = Convert.ToInt32(Console.ReadLine());
  287.  
  288.                                 CheckSolution(num1MaSub, "-", num2MaSub, userSolutionMaSub, gameType, difficulty, numberOfQuestions);
  289.                             };
  290.                             break;
  291.  
  292.                         default:
  293.                             Console.WriteLine("Invalid Operation In Subtraction Game. Re-Running Program!\n");
  294.                             Thread.Sleep(6000);
  295.                             DifficultySelection();
  296.                             break;
  297.                     };
  298.                     break;
  299.  
  300.                 case "multiplication":                    
  301.                     switch (difficulty)
  302.                     {
  303.                         case "easy":
  304.                             for (int i = 1; i < numberOfQuestions; i++)
  305.                             {
  306.                                 Random numberGenEmul = new Random();
  307.  
  308.                                 int num1Emul = numberGenEmul.Next(0, 601);
  309.                                 int num2Emul = numberGenEmul.Next(0, 601);
  310.  
  311.                                 Console.WriteLine("What Is The Product Of: " + num1Emul + " * " + num2Emul);
  312.  
  313.                                 int userSolutionEmul = Convert.ToInt32(Console.ReadLine());
  314.  
  315.                                 CheckSolution(num1Emul, "*", num2Emul, userSolutionEmul, gameType, difficulty, numberOfQuestions);
  316.                             };
  317.                             break;
  318.  
  319.                         case "medium":
  320.                             for (int i = 1; i < numberOfQuestions; i++)
  321.                             {
  322.                                 Random numberGenMmul = new Random();
  323.  
  324.                                 int num1Mmul = numberGenMmul.Next(600, 1201);
  325.                                 int num2Mmul = numberGenMmul.Next(600, 1201);
  326.  
  327.                                 Console.WriteLine("What Is The Product Of: " + num1Mmul + " * " + num2Mmul);
  328.  
  329.                                 int userSolutionMmul = Convert.ToInt32(Console.ReadLine());
  330.  
  331.                                 CheckSolution(num1Mmul, "*", num2Mmul, userSolutionMmul, gameType, difficulty, numberOfQuestions);
  332.                             };
  333.                             break;
  334.  
  335.                         case "hard":
  336.                             for (int i = 1; i < numberOfQuestions; i++)
  337.                             {
  338.                                 Random numberGenHmul = new Random();
  339.  
  340.                                 int num1Hmul = numberGenHmul.Next(1200, 1801);
  341.                                 int num2Hmul = numberGenHmul.Next(1200, 1801);
  342.  
  343.                                 Console.WriteLine("What Is The Product Of: " + num1Hmul + " * " + num2Hmul);
  344.  
  345.                                 int userSolutionHmul = Convert.ToInt32(Console.ReadLine());
  346.  
  347.                                 CheckSolution(num1Hmul, "*", num2Hmul, userSolutionHmul, gameType, difficulty, numberOfQuestions);
  348.                             };
  349.                             break;
  350.  
  351.                         case "expert":
  352.                             for (int i = 1; i < numberOfQuestions; i++)
  353.                             {
  354.                                 Random numberGenExMul = new Random();
  355.  
  356.                                 int num1ExMul = numberGenExMul.Next(1800, 2401);
  357.                                 int num2ExMul = numberGenExMul.Next(1800, 2401);
  358.  
  359.                                 Console.WriteLine("What Is The Product Of: " + num1ExMul + " * " + num2ExMul);
  360.  
  361.                                 int userSolutionExMul = Convert.ToInt32(Console.ReadLine());
  362.  
  363.                                 CheckSolution(num1ExMul, "*", num2ExMul, userSolutionExMul, gameType, difficulty, numberOfQuestions);
  364.                             };
  365.                             break;
  366.  
  367.                         case "master":
  368.                             for (int i = 1; i < numberOfQuestions; i++)
  369.                             {
  370.                                 Random numberGenMaMul = new Random();
  371.  
  372.                                 int num1MaMul = numberGenMaMul.Next(2400, 3001);
  373.                                 int num2MaMul = numberGenMaMul.Next(2400, 3001);
  374.  
  375.                                 Console.WriteLine("What Is The Product Of: " + num1MaMul + " * " + num2MaMul);
  376.  
  377.                                 int userSolutionMaMul = Convert.ToInt32(Console.ReadLine());
  378.  
  379.                                 CheckSolution(num1MaMul, "*", num2MaMul, userSolutionMaMul, gameType, difficulty, numberOfQuestions);
  380.                             };
  381.                             break;
  382.  
  383.                         default:
  384.                             Console.WriteLine("Invalid Operation In Multiplication Game. Re-Running Program!\n");
  385.                             Thread.Sleep(6000);
  386.                             DifficultySelection();
  387.                             break;
  388.                     };
  389.                     break;
  390.  
  391.                 /*
  392.                 this section needs to be tweaked to match doubles as sometimes there are smaller
  393.                 numbers divided by bigger numbers like 24 / 156 which would be a double or float
  394.                 and the same tweaks need to occur in the CheckSolution() method to be able to check
  395.                 the users solution appropriately
  396.                 */
  397.                 case "division":
  398.  
  399.                     switch (difficulty)
  400.                     {
  401.                         case "easy":
  402.                             for (int i = 1; i < numberOfQuestions; i++)
  403.                             {
  404.                                 Random numberGenEdiv = new Random();
  405.  
  406.                                 int num1Ediv = numberGenEdiv.Next(0, 601);
  407.                                 int num2Ediv = numberGenEdiv.Next(0, 601);
  408.  
  409.                                 Console.WriteLine("What Is The Product Of: " + num2Ediv + " / " + num1Ediv);
  410.  
  411.                                 int userSolutionEdiv = Convert.ToInt32(Console.ReadLine());
  412.  
  413.                                 CheckSolution(num1Ediv, "*", num2Ediv, userSolutionEdiv, gameType, difficulty, numberOfQuestions);
  414.                             };
  415.                             break;
  416.  
  417.                         case "medium":
  418.                             for (int i = 1; i < numberOfQuestions; i++)
  419.                             {
  420.                                 Random numberGenMdiv = new Random();
  421.  
  422.                                 int num1Mdiv = numberGenMdiv.Next(600, 1201);
  423.                                 int num2Mdiv = numberGenMdiv.Next(600, 1201);
  424.  
  425.                                 Console.WriteLine("What Is The Quotient Of: " + num2Mdiv + " / " + num1Mdiv);
  426.  
  427.                                 int userSolutionMdiv = Convert.ToInt32(Console.ReadLine());
  428.  
  429.                                 CheckSolution(num1Mdiv, "/", num2Mdiv, userSolutionMdiv, gameType, difficulty, numberOfQuestions);
  430.                             };
  431.                             break;
  432.  
  433.                         case "hard":
  434.                             for (int i = 1; i < numberOfQuestions; i++)
  435.                             {
  436.                                 Random numberGenHdiv = new Random();
  437.  
  438.                                 int num1Hdiv = numberGenHdiv.Next(1200, 1801);
  439.                                 int num2Hdiv = numberGenHdiv.Next(1200, 1801);
  440.  
  441.                                 Console.WriteLine("What Is The Quotient Of: " + num2Hdiv + " / " + num1Hdiv);
  442.  
  443.                                 int userSolutionHdiv = Convert.ToInt32(Console.ReadLine());
  444.  
  445.                                 CheckSolution(num1Hdiv, "/", num2Hdiv, userSolutionHdiv, gameType, difficulty, numberOfQuestions);
  446.                             };
  447.                             break;
  448.  
  449.                         case "expert":
  450.                             for (int i = 1; i < numberOfQuestions; i++)
  451.                             {
  452.                                 Random numberGenExDiv = new Random();
  453.  
  454.                                 int num1ExDiv = numberGenExDiv.Next(1800, 2401);
  455.                                 int num2ExDiv = numberGenExDiv.Next(1800, 2401);
  456.  
  457.                                 Console.WriteLine("What Is The Quotient Of: " + num2ExDiv + " / " + num1ExDiv);
  458.  
  459.                                 int userSolutionExDiv = Convert.ToInt32(Console.ReadLine());
  460.  
  461.                                 CheckSolution(num1ExDiv, "/", num2ExDiv, userSolutionExDiv, gameType, difficulty, numberOfQuestions);
  462.                             };
  463.                             break;
  464.  
  465.                         case "master":
  466.                             for (int i = 1; i < numberOfQuestions; i++)
  467.                             {
  468.                                 Random numberGenMaDiv = new Random();
  469.  
  470.                                 int num1MaDiv = numberGenMaDiv.Next(2400, 3001);
  471.                                 int num2MaDiv = numberGenMaDiv.Next(2400, 3001);
  472.  
  473.                                 Console.WriteLine("What Is The Quotient Of: " + num2MaDiv, " / " + num1MaDiv);
  474.  
  475.                                 int userSolutionMaDiv = Convert.ToInt32(Console.ReadLine());
  476.  
  477.                                 CheckSolution(num1MaDiv, "/", num2MaDiv, userSolutionMaDiv, gameType, difficulty, numberOfQuestions);
  478.                             };
  479.                             break;
  480.  
  481.                         default:
  482.                             Console.WriteLine("Invalid Operation In Division Game. Re-Running Program!\n");
  483.                             Thread.Sleep(6000);
  484.                             DifficultySelection();
  485.                             break;
  486.                     };
  487.                     break;
  488.  
  489.                 default:
  490.                     Console.WriteLine("Invalid Operation In Launching Game. Re-Running Program!\n");
  491.                     Thread.Sleep(6000);
  492.                     DifficultySelection();
  493.                     break;
  494.             };
  495.         }
  496.  
  497.         // select the game to play
  498.         static void GameSelection(string difficulty)
  499.         {
  500.             Console.WriteLine("Please Select Which Game To Play");
  501.  
  502.             List<string> gameTypes = new()
  503.             {
  504.                 "Addition",
  505.                 "Subtraction",
  506.                 "Multiplication",
  507.                 "Division"
  508.             };
  509.  
  510.             for (int i = 0; i < gameTypes.Count; i++)
  511.             {
  512.                 Console.WriteLine(i + 1 + ") " + gameTypes[i]);
  513.             };
  514.  
  515.             int gameSelection = Convert.ToInt32(Console.ReadLine());
  516.  
  517.             Console.WriteLine("How Many Questions Would You Like To Answer? ");
  518.  
  519.             int numberOfQuestions = Convert.ToInt32(Console.ReadLine());
  520.  
  521.             switch (gameSelection)
  522.             {
  523.                 case 1:
  524.                     Console.WriteLine("\nLaunching: " + gameTypes[gameSelection - 1] + "\nMode: " + difficulty.ToUpper() + "\nNumber Of Questions: " + numberOfQuestions);
  525.                     Thread.Sleep(5000);
  526.                     StartGame(gameTypes[gameSelection-1].ToLower(), difficulty.ToLower(), numberOfQuestions);
  527.                     break;
  528.                 case 2:
  529.                     Console.WriteLine("\nLaunching: " + gameTypes[gameSelection - 1] + "\nMode: " + difficulty.ToUpper() + "\nNumber Of Questions: " + numberOfQuestions);
  530.                     Thread.Sleep(5000);
  531.                     StartGame(gameTypes[gameSelection-1].ToLower(), difficulty.ToLower(), numberOfQuestions);
  532.                     break;
  533.                 case 3:
  534.                     Console.WriteLine("\nLaunching: " + gameTypes[gameSelection - 1] + "\nMode: " + difficulty.ToUpper() + "\nNumber Of Questions: " + numberOfQuestions);
  535.                     Thread.Sleep(5000);
  536.                     StartGame(gameTypes[gameSelection-1].ToLower(), difficulty.ToLower(), numberOfQuestions);
  537.                     break;
  538.                 case 4:
  539.                     Console.WriteLine("\nLaunching: " + gameTypes[gameSelection - 1] + "\nMode: " + difficulty.ToUpper() + "\nNumber Of Questions: " + numberOfQuestions);
  540.                     Thread.Sleep(5000);
  541.                     StartGame(gameTypes[gameSelection-1].ToLower(), difficulty.ToLower(), numberOfQuestions);
  542.                     break;
  543.                 default:
  544.                     Console.WriteLine("Invalid Operation Starting Game. Try Again!\n");
  545.                     GameSelection("undefined");
  546.                     break;
  547.             };
  548.         }
  549.  
  550.         // select difficulty type
  551.         static void DifficultySelection()
  552.         {
  553.             List<string> difficulties = new List<string>
  554.             {
  555.                 "Easy",
  556.                 "Medium",
  557.                 "Hard",
  558.                 "Expert",
  559.                 "Master"
  560.             };
  561.  
  562.             Console.WriteLine("Please Select A Game Difficulty");
  563.  
  564.             for (int i = 0; i < difficulties.Count; i++)
  565.             {
  566.                 Console.WriteLine(i+1 + ") " + difficulties[i]);
  567.             };
  568.  
  569.             int difficultySelection = Convert.ToInt32(Console.ReadLine());
  570.  
  571.             switch (difficultySelection)
  572.             {
  573.                 case 1:
  574.                     Console.WriteLine("Easy Mode Selected\n");
  575.                     GameSelection("easy");
  576.                     break;
  577.                 case 2:
  578.                     Console.WriteLine("Medium Mode Selected\n");
  579.                     GameSelection("medium");
  580.                     break;
  581.                 case 3:
  582.                     Console.WriteLine("Hard Mode Selected\n");
  583.                     GameSelection("hard");
  584.                     break;
  585.                 case 4:
  586.                     Console.WriteLine("Expert Mode Selected\n");
  587.                     GameSelection("expert");
  588.                     break;
  589.                 case 5:
  590.                     Console.WriteLine("Master Mode Selected\n");
  591.                     GameSelection("master");
  592.                     break;
  593.                 default:
  594.                     Console.WriteLine("Invalid Operation Selecting Difficulty. Try Again!\n");
  595.                     DifficultySelection();
  596.                     break;
  597.             };
  598.         }
  599.  
  600.         // start the program with the welcome message
  601.         static void Main(string[] args)
  602.         {
  603.             Console.WriteLine("Welcome To Mek's Math Game!\n");
  604.             Thread.Sleep(600);
  605.             Console.WriteLine(
  606.                 "This is meant to be a learning game for your enjoyment. All recorded games are erased once" +
  607.                 " the program has been closed. In future updates, we do plan to add in the ability of saving" +
  608.                 " previous games so that they're always available to the user. If you have any ideas that you" +
  609.                 " would like to add to the game, or would like to see implimented, please send an email to" +
  610.                 " [email protected] with the subject of Mek's Math Game - Suggestions\n"
  611.             );
  612.             Thread.Sleep(1200);
  613.             DifficultySelection();
  614.         }
  615.     };
  616. };
  617.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement