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

namespace HiLo
{
    static class HiLoGame
    {
        public const int MAXIMUM = 10;
        private static Random random = new Random();
        private static int currentNumber = random.Next(1, MAXIMUM + 1);
        private static int pot = 10;

        public static int GetPot() { return pot; }

        public static void Guess(bool higher)
        {
            int nextNumber = random.Next(1, MAXIMUM + 1);
            if ((higher && nextNumber >= currentNumber) ||
                    (!higher && nextNumber <= currentNumber))
            {
                Console.WriteLine("Zgadłeś!");
                pot++;
            }
            else
            {
                Console.WriteLine("Niestety, błędna odpowiedź.");
                pot--;
            }
            currentNumber = nextNumber;
            Console.WriteLine($"Aktualna wartość to {currentNumber}.");
        }

        public static void Hint()
        {
            int half = MAXIMUM / 2;
            if (currentNumber >= half)
                Console.WriteLine($"Liczba znajduje się w górnej {half}");
            else Console.WriteLine($"Liczba znajduje się w dolnej {half}");
            pot--;
        }
    }

}
