Sayı Tahmin Oyunu

Gizli sayıyı bulabilir misin? Oyun her tahmin sonrası büyük mü küçük mü olduğunu söyler.

Tarayıcıda çalışır Tarayıcıda çalışır

Strateji İpucu

İkili arama kullan: her seferinde aralığın ortasını tahmin et. 1-100 için en fazla 7, 1-1000 için en fazla 10 denemede bulursun.

Maksimum Deneme

ZorlukMaks.
1–100 (Kolay)7
1–500 (Orta)9
1–1000 (Zor)10

İkili arama stratejisiyle

Nasıl kullanılır?

  1. 1
    Zorluk SeçKolay (1–100), Orta (1–500) veya Zor (1–1000) seçip Yeni Oyun'a tıkla.
  2. 2
    Tahminini GirBir sayı yaz ve Tahmin Et'e tıkla. Oyun sayının büyük mü küçük mü olduğunu söyler.
  3. 3
    Sayıyı BulAralığı daraltmaya devam et. Aralık çubuğu kalan olasılıkları gösterir.

Sıkça sorulan sorular

Minimum kaç tahminde bulunabilir?
Optimal ikili arama stratejisiyle: 1-100 için 7, 1-500 için 9, 1-1000 için 10 tahmin yeterli.
Sayı gerçekten rastgele mi?
Evet. Her yeni oyunda tarayıcının Math.random() fonksiyonu kullanılır. Önceden belirlenmiş değil.
Skorlarım kaydediliyor mu?
Hayır. Bu skor kaydı olmayan, verisi sunucuya gitmeyen bir tarayıcı oyunudur.

How to Play the Number Guessing Game

The computer picks a secret number within the chosen range. You enter guesses one at a time, and the game responds with Too High or Too Low after each attempt. Your goal is to find the exact number in as few guesses as possible.

Binary Search Strategy

The most efficient strategy is binary search: always guess the midpoint of the current possible range. If the range is 1–100, guess 50. If told too high, the range becomes 1–49 — guess 25. This approach guarantees finding any number in 1–100 within 7 guesses, any number in 1–1000 within 10 guesses.

Why Is This Game Educational?

The guessing game is a classic introduction to binary search — one of the most fundamental algorithms in computer science. It demonstrates how logarithmic efficiency works in practice: doubling the range only adds one extra guess needed.

Yorumlar