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;
- namespace ConsoleApplication3
- {
- class Program
- {
- static void Main(string[] args)
- {
- string player1, player2;
- bool Done = false;
- int Number;
- Console.WriteLine("Podaj imie gracza 1: ");
- player1 = Console.ReadLine();
- Console.WriteLine("Podaj imie gracza 2: ");
- player2 = Console.ReadLine();
- Random RandomObj = new Random();
- int x = RandomObj.Next(1000);
- string player = player1;
- while (!Done)
- {
- player = player == player1 ? player2 : player1;
- Console.WriteLine(player + ", go,go!");
- Number = Convert.ToInt32(Console.ReadLine());
- if (x > Number)
- {
- Console.WriteLine("Liczba jest wieksza niz podana");
- }
- else if (x < Number)
- {
- Console.WriteLine("liczba jest mniejsza niz podana");
- }
- else
- {
- Console.WriteLine("dobrze. wygral gracz" + player);
- Done = true;
- }
- }
- Console.ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement