Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading;
- using System.Threading.Tasks;
- namespace Opgave_4_5
- {
- class Program
- {
- static void Main(string[] args)
- {
- int count = 0;
- while(true)
- {
- Console.Clear();
- Console.Write("Gæt et ord: ");
- string ord = Console.ReadLine();
- Console.Clear();
- if (ord == "slut")
- {
- Console.ForegroundColor = ConsoleColor.Green;
- Console.WriteLine("Du gættet rigtigt!");
- Console.ForegroundColor = ConsoleColor.Gray;
- ++count;
- Console.Write("Du brugte {0} forsøg", count);
- Thread.Sleep(5000);
- count = 0;
- }
- else
- {
- Console.ForegroundColor = ConsoleColor.Red;
- Console.Write("Du gættet ikke rigtigt");
- Console.ForegroundColor = ConsoleColor.Gray;
- Console.Write(":(");
- Thread.Sleep(2000);
- count++;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement