Bulls and Cows Game
Check the rules of the game, fill in the following functions, select the opponent, and click the Start Game button to start the battle.
The opponent and I each have their own number (3 digits with 3 different numbers), and it is a game to win by guessing the opponent's number first. If both sides guess at same time, the larger number wins.
When round is started, you need to return your number and predict opponent's number at the beginning of every turn. When turn is ended, you receive the results of comparing the opponent's number and the predicted number.
If the matching digits are in their right positions, they are 'bulls', if in different positions, they are 'cows'
Code battle is a battle between your code and opponent's code, and the language is JAVASCRIPT.
Fill in the code, select the opponent (RANDOM, LEVEL1, LEVEL2, LEVEL3, Online opponent) and then press the game start button will start the match.
1 game consists of 31 rounds, 1 round will continue until one side wins or 30 turns(the larger number wins).
Code battle's lifecycle callback functions are onGameStart, onRoundStart, onTurnStart, onTurnEnd, onRoundEnd, onGameEnd, and you have to implement your own logic on each function.
Building a basic strategy of the game, analyzing your opponent's pattern and returning the best choice from onTurnStart is the key to winning.
Opponents: <= If you join here, other users can see you.
TURN
COUNT
0
ROUND
WINLOSE
00
GAME
WINLOSE
00
The entire game log is displayed in the area below.
If you or the opponent's screen is not visible, the communication speed will be slower.