Ara

C SHARP CONSOLE SAYI TAHMİN OYUNU

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace sayitahminioyunu
{
    class Program
    {
        static void Main(string[] args)
        {

            Random sayi = new Random();
            int devam = 0;
            while (true)
            {
                int ustsinir = 100, girilenSayi;
                int üretilen = sayi.Next(ustsinir);
                Console.WriteLine("Yeni oyun Başladı...");
                Console.WriteLine(ustsinir + " dan kucuk bir sayi giriniz");
                while (true)
                {
                    girilenSayi = Convert.ToInt32(Console.ReadLine());
                    if (girilenSayi < üretilen)
                        Console.WriteLine("daha büyük bir sayi giriniz");
                    else
                        if (girilenSayi > üretilen)
                            Console.WriteLine("daha kücük bir sayi giriniz");
                        else
                            if (girilenSayi == üretilen)
                            {
                                Console.WriteLine("Tebrikler bildiniz");
                                break;
                            }
                }
                Console.WriteLine("Yeni oyun icin->1, cikmak icin ->0 giriniz");
                devam = Convert.ToInt32(Console.ReadLine());
                Console.Clear();
                if (devam == 0)
                    break;
            }
        }
    }
}