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.Tasks;
- namespace ConsoleApp12
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.Title = "Gissa Tal";
- Console.WriteLine("Gissa ett tal mellan 1 och 100");
- Random aiRandom = new Random();
- int aiGuess = aiRandom.Next(1, 101);
- while (true)
- {
- int guess = Convert.ToInt32(Console.ReadLine());
- if (guess == aiGuess)
- {
- Console.WriteLine("Du gissade Rätt!");
- Console.ReadLine();
- }
- if (guess >= aiGuess)
- {
- Console.WriteLine("Talet är Mindre");
- }
- if (guess <= aiGuess)
- {
- Console.WriteLine("Talet är Högre");
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement