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 Gierka
- {
- class Program
- {
- static void Main(string[] args)
- {
- int liczba = -1 ;
- int liczba2;
- int zmienna2;
- string wybor;
- string wybor2;
- int zmienna;
- do
- {
- zmienna = 0;
- zmienna2 = 0;
- Console.WriteLine("Wybierz poziom trudnosci:");
- Console.WriteLine(" 1.latwy (przedzial 1-10)\n 2.sredni (przedzial 1-30)\n 3.trudny (przedzial 1-50)");
- wybor = Console.ReadLine();
- if (wybor == "1")
- {
- Random rand = new Random();
- liczba = rand.Next(0, 10);
- }
- if (wybor == "2")
- {
- Random rand = new Random();
- liczba = rand.Next(0, 30);
- }
- if (wybor == "3")
- {
- Random rand = new Random();
- liczba = rand.Next(0, 50);
- }
- do
- {
- Console.WriteLine("Wpisz Liczbe");
- wybor2 = Console.ReadLine();
- liczba2 = int.Parse(wybor2);
- if (liczba2 == liczba)
- {
- zmienna2 = 1;
- Console.WriteLine("Brawo, zgadles!");
- Console.WriteLine("Chcesz zagrac jeszcze raz ? T/N");
- wybor2 = Console.ReadLine();
- if (wybor2 == "T" || wybor2 == "t")
- {
- zmienna = 1;
- }
- else
- zmienna = 0;
- }
- if (liczba2 < liczba)
- {
- Console.WriteLine("Wprowadzona liczba jest mniejsza od tej ktora masz zgadnac");
- }
- if (liczba2 > liczba)
- {
- Console.WriteLine("Wprowadzone liczba jest wieksza od tej ktora masz zagnac");
- }
- }
- while (zmienna2 == 0);
- }
- while (zmienna == 1);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement