SK Planet Code Baseball Classic
This match is a 1:1 match between Player 1 and Player 2's code, and the programming language is JAVASCRIPT.
After checking the game rules, writing the codes for Player 1 and Player 2, click the Start Game button to start the match.
1 game consists of 7 rounds, and 1 round repeats the turn until all 9 innings are finished.
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 at onTurnStart is the key to winning.
(Any attempt to cheat, such as affecting the opponent's code, will result in defeat.)
The game rules

Player 1

Player 2

Strike Zone
0,00,10,2
1,01,11,2
2,02,12,2
Ball Count
S0
B0
O0
Runners
1B
2B
3B
Score Board
1 2 3 4 5 6 7 8 9 R Win
Player 1 0 0 0 0 0 0 0 0 0 0 0
Player 2 0 0 0 0 0 0 0 0 0 0 0
The entire game log is displayed in the area below.