After finishing their mushroom game, Yeti and Pink Bean have moved to Grandis. Reminiscing about the past when they threw dice using the Roll of the Dice skill, they play a board game called Yacht Auction.
The bidding phase proceeds as follows:
From the dice currently in hand (exception: only dice are available in the final scoring phase), the player selects dice. Then, the player chooses one of the following Scoring Rules to earn points. Each scoring rule can be used at most once per match.
ONE: pointsTWO: pointsTHREE: pointsFOUR: pointsFIVE: pointsSIX: pointsAdditionally, if a player earns a total of points or more from the Basic Scoring Rules, they receive a Bonus Score of points.
CHOICE: pointsFOUR_OF_A_KIND: If there are or more dice of same value, points. Otherwise, points.FULL_HOUSE: If there are dice of same value plus other dice of same value, points. Otherwise, points.SMALL_STRAIGHT: If there are dice which form a consecutive sequence (), points. Otherwise, points.LARGE_STRAIGHT: If all dice form a consecutive sequence (), points. Otherwise, points.YACHT: If all dice have the same value, points. Otherwise, points.After all rounds are completed, the player with the higher total score wins. If the total scores are equal, the game ends with draw.
Your program must read input line by line and follow the protocol of each command. Commands requiring the output are denoted with red color with their time limit specified. If your program fails to output within specified time limit, you will receive Time Limit Exceeded (TLE) verdict and will result forfeiting the game.
| Command | Input Format | Description |
|---|---|---|
| READY | READY | Must output OK within 3 seconds as a response. |
| ROLL | ROLL a₁a₂a₃a₄a₅ b₁b₂b₃b₄b₅ | Indicates dice in Group A are and Group B are . Output BID g x within 0.5 seconds. This corresponds bidding points for group . must be A or B, and must be an integer between and . |
| GET | GET g g₀ x₀ | Indicates you took group as a result of the bidding. The opponent bid points for group . |
| SCORE | SCORE | Indicates the start of the scoring phase. Output PUT c d₁d₂d₃d₄d₅ within 0.5 seconds. This corresponds using rule with dice from your possession. |
| SET | SET c d₁d₂d₃d₄d₅ | Indicates the opponent used rule with dice during their scoring phase. |
| FINISH | FINISH | Indicates the end of the game. The program must terminate properly and immediately, regardless of the current status of the game. Output is not required. |
All commands must be processed line by line. When you output, make sure you print a newline character and then flush the buffer. Please refer to the reference document or sample code of your programming language on how to flush the buffer.
The following are sample codes provided for each language:
The sample code uses following strategy:
Once the submitted code compiles successfully, it will compete against a total of 10 sample AIs. One match is played against each sample AI. Points are awarded as follows:
| Battle No. | Description | Code | data.bin |
|---|---|---|---|
| 1 | Performs the same actions as the provided sample code. | Code | |
| 2 | Bidding: Bids (difference in group sums) on the group with the higher sum. Scoring: Uses the rule and combination that yields the immediate highest possible score. | Code | |
| 3 | Bidding: Randomly picks A or B and bids points. Scoring: Uses the rule and combination that yields the immediate highest possible score. | Code | |
| 4 | Bidding: Randomly picks A or B and bids points. Scoring: Prioritizes combinations that are difficult to score. | Code | |
| 5 | Bidding: Randomly picks A or B and bids points. Scoring: Prioritizes Basic Scoring Rules. | Code | data |
| 6 | Bidding: Bids defensively on better combinations. Scoring: Prioritizes Basic Scoring Rules. | Code | data |
| 7 | Bidding: Bids aggressively on better combinations. Scoring: Prioritizes Basic Scoring Rules. | Code | data |
| 8 | Bidding: Randomly picks A or B and bids points. Scoring: Prioritizes Combination Scoring Rules. | Code | data |
| 9 | Bidding: Bids defensively on better combinations. Scoring: Prioritizes Combination Scoring Rules. | Code | data |
| 10 | Bidding: Bids aggressively on better combinations. Scoring: Prioritizes Combination Scoring Rules. | Code | data |
Note: Sample AI codes and
data.binfiles were not provided during the actual contest.
A testing tool, testing-tool-yacht, is provided to test the program. You can test your compiled executable or script locally, using python, java, node, or lua in your envinroment.
.exe file..dmg file, then drag and drop the testing-tool-yacht file into the Applications folder. Then, run the app..deb file using apt or dpkg, then run testing-tool-yacht..rpm file using rpm or yum, then run testing-tool-yacht.A CLI testing tool package, testing-tool-yacht-cli.zip (Download), is provided to test the program. For details, refer to the README.md inside the zip file.
You can freely modify the CLI testing tool and discuss its execution methods with others. However, you must not share modified tools or log files generated by the tool with anyone outside your team, nor discuss them.
You will receive log files having same format with testing tool, in the submission result dialogue. However, actual grading program is implemented differently from the testing tool, a successful execution in the testing tool does not always guarantee a successful execution in the actual grading.
You can download log files for each battle from the Sample AI matches. Use the Log Visualization Tool to examine how the game progressed and refine your strategy.
35561 15336 0
31452 33164 0
21464 46146 0
51211 45446 1
62612 34411 1
12421 36431 0
54344 36225 1
13653 32122 0
53644 61453 0
64215 15142 1
35522 44162 1
54111 55424 1
| First Player Input | First Player Output | Second Player Input | Second Player Output | Log |
|---|---|---|---|---|
READY | OK | READY | OK | |
ROLL 35561 15336 | ROLL 35561 15336 |
| ||
BID A 123 | BID A 456 |
| ||
GET B A 456 | GET A A 123 |
| ||
ROLL 31452 33164 | ROLL 31452 33164 |
| ||
BID A 99 | BID B 11 |
| ||
GET A B 11 | GET B A 99 |
| ||
SCORE | SCORE | |||
PUT ONE 35561 | PUT THREE 13356 |
| ||
SET THREE 13356 | SET ONE 35561 | |||
| (Rounds 3-12 omitted) | ||||
SCORE | SCORE |
| ||
PUT YACHT 12556 | PUT FULL_HOUSE 42533 |
| ||
SET FULL_HOUSE 42533 | SET YACHT 12556 | |||
FINISH | (Program ends) | FINISH | (Program ends) |
|
|