Advertisement
Guest User

Jeopardy

a guest
Sep 26th, 2019
3,919
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 12.75 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApp4
  8. {
  9.     class Program
  10.     {
  11.         static string[] categories = new string[36];
  12.         static int[] categoryValues = new int[36];
  13.         static string[] questions = new string[90];
  14.         static string[] answers = new string[90];
  15.         static string[,] board = new string[6, 6];
  16.         static string inputChoose;
  17.         static string inputAnswer;
  18.         static string answer;
  19.         static string question;
  20.         static int questionIndex;
  21.         static void Main(string[] args)
  22.         {
  23.             int endGame = 0;
  24.             int currentPoints = 0;
  25.             Q_A();
  26.             PointValues();
  27.             bool pass = true;
  28.             Console.WriteLine("Welcome to jeopardy, would you like to play? Type 'yes' or 'no'");
  29.             string startGame = Console.ReadLine();
  30.  
  31.  
  32.             if (startGame == "yes")
  33.             {
  34.                 Console.WriteLine("Remember, you must answer with 'what is <answer>' in order to get it right. \nYou must also answer everything in LOWER CASE! \nPress enter to start.");
  35.                 Console.ReadLine();
  36.                 Console.Clear();
  37.                 Console.WriteLine("Great, let's start. Here's the board with the following categories\n");
  38.                 StartBoard();
  39.                 while (pass == true)
  40.                 {
  41.                     Console.WriteLine("\nPick a category and value");
  42.                     inputChoose = Console.ReadLine();
  43.                     for (int x = 0; x < 36; x++)
  44.                     {
  45.                         if (inputChoose == categories[x])
  46.                         {
  47.                             questionIndex = x;
  48.                             categories[x] = "_______";
  49.                             answer = answers[x];
  50.                             question = questions[x];
  51.                             Console.WriteLine(question);
  52.                             inputAnswer = Console.ReadLine();
  53.                             endGame++;
  54.                         }
  55.                     }
  56.                     Console.Clear();
  57.                     int count = 0;
  58.                     for (int x = 0; x < board.GetLength(0); x++)
  59.                     {
  60.                         for (int y = 0; y < board.GetLength(1); y++)
  61.                         {
  62.                             Console.Write(categories[count]);
  63.                             count++;
  64.                             if (y < board.GetLength(1) - 1)
  65.                             {
  66.                                 Console.Write(" | ");
  67.                             }
  68.                         }
  69.                         Console.WriteLine();
  70.                     }
  71.                     if (inputAnswer == answer)
  72.                     {
  73.                         currentPoints += categoryValues[questionIndex];
  74.                         Console.WriteLine($"\nCorrect, you now have {currentPoints} points\nPress enter to continue");
  75.                         Console.ReadLine();
  76.                     }
  77.                     else
  78.                     {
  79.                         Console.WriteLine($"\nThat's wrong, you still have {currentPoints} points\nPress enter to continue");
  80.                         Console.ReadLine();
  81.                     }
  82.                     if (endGame == 30)
  83.                     {
  84.                         Console.Clear();
  85.                         Console.WriteLine($"\nThanks for playing! You scored {currentPoints}/9000 points!\nPress enter to exit.");
  86.                         Console.ReadLine();
  87.                         pass = false;
  88.                     }
  89.                 }
  90.         }
  91.         }
  92.         static void Q_A()
  93.         {
  94.             for (int i = 0; i < 36; i++)
  95.             {
  96.                 //pokemon
  97.                 questions[6] = "This pokemon has the pokeindex of #001"; //bulbasaur
  98.                 questions[12] = "This pokemon was the original starter pokemon for Ash Ketchum"; //pikachu
  99.                 questions[18] = "This many pokemon are in the gen 1 pokedex once it's filled out"; //151
  100.                 questions[24] = "The pokemon you get from the Old Amber fossil in gen 1"; //aerodactyl
  101.                 questions[30] = "This many pokemon naturally learn the move 'Hyper Beam' as they level up"; //6, gyarados, aerodactyl, snorlax, dratini, dragonair, dragonite.
  102.                                                                                                            //friends
  103.                 questions[7] = "This is the last name of the two main characters that are siblings"; //geller
  104.                 questions[13] = "This is the phrase the name of the episodes almost always start with"; //the one
  105.                 questions[19] = "This many times did Ross get divorced"; //3
  106.                 questions[25] = "This is Chandler Bing's middle name"; //muriel
  107.                 questions[31] = "This city is where Rachel went on Ross and Emily's honeymoon"; //athens
  108.                 //videogames
  109.                 questions[8] = "This company is the creator of Minecraft";//mojang
  110.                 questions[14] = "This game is where all the 12 year olds go to get victory royales";//fortnite
  111.                 questions[20] = "This many main story 'The Sims' games have been made";//4
  112.                 questions[26] = "In this type of game, 10 players team up in a 5v5 game, with three lanes and a jungle filled with monsters";//Magnavox Odyssey
  113.                 questions[32] = "This is the current Any% speedrun world record of Super Mario Bros (in mm:ss)";//04:55
  114.                 //capitals
  115.                 questions[9] = "The capital of Denmark"; //Copenhagen
  116.                 questions[15] = "The capital of Norway"; //Oslo
  117.                 questions[21] = "The capital of Australia"; //Canberra
  118.                 questions[27] = "The capital of Belarus"; //Minsk
  119.                 questions[33] = "The capital of Slovenia"; //Ljubljana
  120.                 //coding
  121.                 questions[10] = "This variable is a number that ranges from 0 to 255"; //byte
  122.                 questions[16] = "This variable is a variable that can contain a sentence (lots of characters)"; //string
  123.                 questions[22] = "Something that runs a certain amount of time, specified by either 'for' or 'while'"; //loop
  124.                 questions[28] = "A variable that holds an amount of values, associated with a key"; //array
  125.                 questions[34] = "A function you should never use"; //goto
  126.                 //movies
  127.                 questions[11] = "Katniss Everdeen is an expert ranger in this movie series";//The Hunger Games
  128.                 questions[17] = "A Tragic romace by Shakespear originally from 1595, made to film in 1996"; //Romeo and Juliet
  129.                 questions[23] = "This is the name of the actor playing 'Harry Potter'";//Daniel Radcliffe
  130.                 questions[29] = "This movie has the highest rating on IMDB"; //The Shawshank Redemption (9,2)
  131.                 questions[35] = "This many Marvel Cinematic Universe films have been made"; //23
  132.  
  133.                 //pokemon
  134.                 answers[6] = "what is bulbasaur";
  135.                 answers[12] = "what is pikachu";
  136.                 answers[18] = "what is 151";
  137.                 answers[24] = "what is aerodactyl";
  138.                 answers[30] = "what is 6"; //gyarados, aerodactyl, snorlax, dratini, dragonair, dragonite";
  139.                 //friends
  140.                 answers[7] = "what is geller";
  141.                 answers[13] = "what is the one";
  142.                 answers[19] = "what is 3";
  143.                 answers[25] = "what is muriel";
  144.                 answers[31] = "what is athens";
  145.                 //videogames
  146.                 answers[8] = "what is mojang";//mojang
  147.                 answers[14] = "what is fortnite";//fortnite
  148.                 answers[20] = "what is 4";//4
  149.                 answers[26] = "what is moba";//moba
  150.                 answers[32] = "what is 04:55";//04:55
  151.                 //capitals
  152.                 answers[9] = "what is copenhagen"; //Copenhagen
  153.                 answers[15] = "what is oslo"; //Oslo
  154.                 answers[21] = "what is canberra"; //Canberra
  155.                 answers[27] = "what is minsk"; //Minsk
  156.                 answers[33] = "what is ljubljana"; //
  157.                 //coding
  158.                 answers[10] = "what is byte"; //byte
  159.                 answers[16] = "what is string"; //string
  160.                 answers[22] = "what is loop"; //loop
  161.                 answers[28] = "what is array"; //array
  162.                 answers[34] = "what is goto"; //goto
  163.                 //movies
  164.                 answers[11] = "what is the hunger games";//The Hunger Games
  165.                 answers[17] = "what is romeo and juliet"; //Romeo and Juliet
  166.                 answers[23] = "what is daniel radcliffe";//Daniel Radcliffe
  167.                 answers[29] = "what is the shawshank redemption"; //The Shawshank Redemption (9,2)
  168.                 answers[35] = "what is 23"; //23
  169.             }
  170.         }
  171.         static void StartBoard()
  172.         {
  173.             Console.Clear();
  174.             PointValues();
  175.             for (int i = 0; i < 36; i++)
  176.             {
  177.                 categories[0] = "Pokemon";
  178.                 categories[1] = "Friends";
  179.                 categories[2] = "Gaming ";
  180.                 categories[3] = "Capital";
  181.                 categories[4] = "Coding ";
  182.                 categories[5] = "Movies ";
  183.  
  184.                 categories[6] = "poke100";
  185.                 categories[7] = "frie100";
  186.                 categories[8] = "game100";
  187.                 categories[9] = "capi100";
  188.                 categories[10] = "code100";
  189.                 categories[11] = "movi100";
  190.  
  191.                 categories[12] = "poke200";
  192.                 categories[13] = "frie200";
  193.                 categories[14] = "game200";
  194.                 categories[15] = "capi200";
  195.                 categories[16] = "code200";
  196.                 categories[17] = "movi200";
  197.  
  198.                 categories[18] = "poke300";
  199.                 categories[19] = "frie300";
  200.                 categories[20] = "game300";
  201.                 categories[21] = "capi300";
  202.                 categories[22] = "code300";
  203.                 categories[23] = "movi300";
  204.  
  205.                 categories[24] = "poke400";
  206.                 categories[25] = "frie400";
  207.                 categories[26] = "game400";
  208.                 categories[27] = "capi400";
  209.                 categories[28] = "code400";
  210.                 categories[29] = "movi400";
  211.  
  212.                 categories[30] = "poke500";
  213.                 categories[31] = "frie500";
  214.                 categories[32] = "game500";
  215.                 categories[33] = "capi500";
  216.                 categories[34] = "code500";
  217.                 categories[35] = "movi500";
  218.             }
  219.             int count = 0;
  220.             for (int x = 0; x < board.GetLength(0); x++)
  221.             {
  222.                 for (int y = 0; y < board.GetLength(1); y++)
  223.                 {
  224.                     Console.Write(categories[count]);
  225.                     count++;
  226.                     if (y < board.GetLength(1) - 1)
  227.                     {
  228.                         Console.Write(" | ");
  229.                     }
  230.                 }
  231.                 Console.WriteLine();
  232.             }
  233.         }
  234.         static void PointValues()
  235.         {
  236.                 categoryValues[0] = 0;
  237.                 categoryValues[1] = 0;
  238.                 categoryValues[2] = 0;
  239.                 categoryValues[3] = 0;
  240.                 categoryValues[4] = 0;
  241.                 categoryValues[5] = 0;
  242.  
  243.                 categoryValues[6] = 100;
  244.                 categoryValues[7] = 100;
  245.                 categoryValues[8] = 100;
  246.                 categoryValues[9] = 100;
  247.                 categoryValues[10] = 100;
  248.                 categoryValues[11] = 100;
  249.  
  250.                 categoryValues[12] = 200;
  251.                 categoryValues[13] = 200;
  252.                 categoryValues[14] = 200;
  253.                 categoryValues[15] = 200;
  254.                 categoryValues[16] = 200;
  255.                 categoryValues[17] = 200;
  256.  
  257.                 categoryValues[18] = 300;
  258.                 categoryValues[19] = 300;
  259.                 categoryValues[20] = 300;
  260.                 categoryValues[21] = 300;
  261.                 categoryValues[22] = 300;
  262.                 categoryValues[23] = 300;
  263.  
  264.                 categoryValues[24] = 400;
  265.                 categoryValues[25] = 400;
  266.                 categoryValues[26] = 400;
  267.                 categoryValues[27] = 400;
  268.                 categoryValues[28] = 400;
  269.                 categoryValues[29] = 400;
  270.  
  271.                 categoryValues[30] = 500;
  272.                 categoryValues[31] = 500;
  273.                 categoryValues[32] = 500;
  274.                 categoryValues[33] = 500;
  275.                 categoryValues[34] = 500;
  276.                 categoryValues[35] = 500;
  277.         }
  278.         }
  279.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement