예제 #1
0
파일: Program.cs 프로젝트: Seqql/Hangman
        public static void Start(ref bool restart)
        {
            bool?         gewonnen = false;
            ScreenOptions so       = new ScreenOptions();

            Console.WriteLine("Enter you word");

            so.read();

            while (gewonnen == false)
            {
                so.check(ref gewonnen);
            }

            if (gewonnen == true)
            {
                Console.WriteLine("Gewonnen!");
            }
            else if (gewonnen == null)
            {
                Console.WriteLine("Verloren!");
            }

            Console.WriteLine("Again?(y/n)");
            ConsoleKeyInfo keyinfo = Console.ReadKey();

            Console.WriteLine();

            if (keyinfo.Key != ConsoleKey.Y)
            {
                restart = false;
            }
        }
예제 #2
0
파일: Program.cs 프로젝트: Seqql/Hangman
        public static void Main(string[] args)
        {
            ScreenOptions so = new ScreenOptions();

            Console.ForegroundColor = ConsoleColor.Green;
            bool restart = true;

            do
            {
                so.Buchstabe.Clear();
                so.Used.Clear();
                Start(ref restart);
            }while (restart);


            Console.ReadKey();
        }