logic for the game "Bull & cows"