Game Rules
Code battle is a battle between your code and opponent's code, and the language is JAVASCRIPT.
Fill in the code, select the opponent (LEVEL1, LEVEL2, LEVEL3, Online opponent) and then press the game start button will start the match.
1 game consists of a maximum of 200 rounds and the game ends if either you or your opponent runs out of money while the round is repeated. And, 1 round consists of several turns. On each turn, you can "raise" to raise table money and pass it to your opponent's turn, or you can "call" or "die" to finish the round.
OnGameStart and onGameEnd functions are called at the beginning and end of the game, onRoundStart and onRoundEnd functions are called at the beginning and end of each round, and onTurnStart is called on each turn. onGameStart => onRoundStart => onTurnStart => onRoundEnd => onGameEnd. You can implement your own logic in 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.
| Order | Group | Name | Remarks |
|---|---|---|---|
| 1 | Gwang-ttaeng | 3 and 8 gwang-ttaeng | When two cards are 3 and 8. Sutda's strongest combination. |
| 2 | Gwang-ttaeng | 1 and 8 gwang-ttaeng | When two cards are 1 and 8. |
| 3 | Gwang-ttaeng | 1 and 3 gwang-ttaeng | When two cards are 1 and 3. |
| 4 | Ttaeng | 10 ttaeng | When two cards are 10 and 20. |
| 5 | Ttaeng | 9 ttaeng | When two cards are 9 and 19. |
| 6 | Ttaeng | 8 ttaeng | When two cards are 8 and 18. |
| 7 | Ttaeng | 7 ttaeng | When two cards are 7 and 17. |
| 8 | Ttaeng | 6 ttaeng | When two cards are 6 and 16. |
| 9 | Ttaeng | 5 ttaeng | When two cards are 5 and 15. |
| 10 | Ttaeng | 4 ttaeng | When two cards are 4 and 14. |
| 11 | Ttaeng | 3 ttaeng | When two cards are 3 and 13. |
| 12 | Ttaeng | 2 ttaeng | When two cards are 2 and 12. |
| 13 | Ttaeng | 1 ttaeng | When two cards are 1 and 11. |
| 14 | Kkeus | 9 kkeus | When the "units" number of the sum of two card is 9. (Ex: 5 and 14, or 3 and 6). If it's the same, compare the big cards. (Ex: ['5' and 4] < [3 and '6']) |
| 15 | Kkeus | 8 kkeus | When the "units" number of the sum of two card is 8. (Ex: 5 and 13, or 6 and 2) |
| 16 | Kkeus | 7 kkeus | When the "units" number of the sum of two card is 7. (Ex: 2 and 15, or 3 and 4) |
| 17 | Kkeus | 6 kkeus | When the "units" number of the sum of two card is 6. (Ex: 5 and 11, or 1 and 5) |
| 18 | Kkeus | 5 kkeus | When the "units" number of the sum of two card is 5. (Ex: 2 and 13, or 3 and 2) |
| 19 | Kkeus | 4 kkeus | When the "units" number of the sum of two card is 4. (Ex: 4 and 10, or 1 and 3) |
| 20 | Kkeus | 3 kkeus | When the "units" number of the sum of two card is 3. (Ex: 1 and 12, or 2 and 1) |
| 21 | Kkeus | 2 kkeus | When the "units" number of the sum of two card is 2. (Ex: 2 and 10, or 3 and 9) |
| 22 | Kkeus | 1 kkeus | When the "units" number of the sum of two card is 1. (Ex: 1 and 10, or 5 and 6) |
| 23 | Kkeus | 0 kkeus | When the "units" number of the sum of two card is 0. (Ex: 1 and 9, or 3 and 7) |
Opponents
TURN