Guess the secret number to enter the castle

The main aim of the game is to guess the secret 4-digit number that the computer generated randomly. No 2 digits are the same; meaning the number doesn't containy any repeated digits.

1) You have to enter a 4 digit number.
2) Every time you guess, the game will show the number of bats and cats in the guess.
3) You have to get 4 cats in order to win.

If a digit in your guess matches a digit in the secret number, but its position is wrong, you get a Bat.

If a digit in your guess matches one in the secret number including its position in the number, you get a cat.

Serpents and spiders, tail of a rat; call in the spirits, wherever they're at.