예제 #1
0
        public static string GetHint()
        {
            string stringOutput = "";

            if ((!EndGame.DoubleEndGame() || !EndGame.SingleEndGame()) && Globals.hintsLeft > 0)
            {
                char[] phrase = Globals.phrase.ToLower().ToCharArray();
                Array.Reverse(phrase);
                char[] alphabet = string.Join("", Globals.alphabet).ToLower().ToCharArray();
                bool   output   = true;

                for (int i = 0; i < phrase.Length; i++)
                {
                    for (int j = 0; j < alphabet.Length && output; j++)
                    {
                        if (phrase[i] == alphabet[j] && Globals.marker[j] != "¯")
                        {
                            stringOutput = Globals.alphabet[j];
                            output       = false;
                        }
                    }
                }
                Globals.hintsLeft--;
                return(stringOutput);
            }
            else
            {
                Console.WriteLine(" No hints left");
                return(stringOutput);
            };
        }
예제 #2
0
        public static void DrawDoubleGame()
        {
            Console.Clear();
            Console.WriteLine("╔══════════════════════════════════════════════════════════════════════════════╗");
            Console.WriteLine("║ " + string.Join("  ", Globals.alphabet) + " ║");
            Console.WriteLine("║ " + string.Join("  ", Globals.marker) + " ║");
            Console.WriteLine("║ " + Globals.image[Globals.triesLeft][0] + "                                                                   ║");
            Console.WriteLine("║ " + Globals.image[Globals.triesLeft][1] + "                                                                   ║");
            Console.WriteLine("║ " + Globals.image[Globals.triesLeft][2] + Line.calculateLine(67, Globals.phraseMarker) + "║");
            Console.WriteLine("║ " + Globals.image[Globals.triesLeft][3] + "                                                                   ║");
            Console.WriteLine("║ " + Globals.image[Globals.triesLeft][4] + "                                                                   ║");
            Console.WriteLine("╠═══════════════════════╦═════════════════╦═════════════════════════╦══════════╣");
            Console.WriteLine("║ Category: " + Line.calculateLine(12, Globals.category) + "║ Hints: " + Globals.hintsLeft + " [hint] ║     Rounds left: " + Globals.roundsLeft / 2 + "      ║  [menu]  ║");
            Console.WriteLine("╠════════════╦══════════╩═╦═══════════════╩═════════════════════╦═══╩══════════╣");
            Console.WriteLine("║  Player 1  ║ " + Line.calculateLine(10, Globals.namePlayer[0]) + " ║             Score: " + Line.calculateLine(4, Globals.scorePlayer[0].ToString()) + "            " + " ║ " + Line.calculateLine(12, Globals.nowGuessing[0]) + " ║");
            Console.WriteLine("╠════════════╬════════════╬═════════════════════════════════════╬══════════════╣");
            Console.WriteLine("║  Player 2  ║ " + Line.calculateLine(10, Globals.namePlayer[1]) + " ║             Score: " + Line.calculateLine(4, Globals.scorePlayer[1].ToString()) + "            " + " ║ " + Line.calculateLine(12, Globals.nowGuessing[1]) + " ║");
            Console.WriteLine("╚════════════╩════════════╩═════════════════════════════════════╩══════════════╝");

            Console.WriteLine("");
            if (!EndGame.DoubleEndGame())
            {
                Console.Write(" Input a letter: ");
            }
        }
예제 #3
0
 public static void DoubleGameLoop()
 {
     while (!EndGame.DoubleEndGame())
     {
         Player.guessingPlayer();
         Draw.DrawDoubleGame();
         UserInput.userInput();
         CheckLetter.checkLetter();
         if (EndGame.wonGame())
         {
             gameOutcome(-1, " The man lives!", "", Draw.DrawDoubleGame);
         }
         if (EndGame.lostGame())
         {
             gameOutcome(-1, " You let the man hang...", " The phrase was: " + Globals.phrase, Draw.DrawDoubleGame);
         }
     }
 }