JohanCDev / Gomoku

🤖 Creation of a bot able to play the Gomoku game. Created in Python with 2 other students. This project is part of my 3rd year at Epitech.
MIT License
2 stars 0 forks source link

Add the INFO command #5

Closed JohanCDev closed 1 year ago

JohanCDev commented 1 year ago

Description of the command

The manager sends information to the brain. The brain can ignore it. However, the brain will lose if it exceeds the limits. The brain must cope with situations when the manager doesn't send all information which is mentioned in this document. Most of this information is sent at the beginning of a match. The time limits will not be changed in the middle of a match during a tournament. It is recommended to react on commands at any time, because the human opponent can change these values even when the brain is thinking. The key can be: timeout_turn - time limit for each move (milliseconds, 0=play as fast as possible) timeout_match - time limit of a whole match (milliseconds, 0=no limit) max_memory - memory limit (bytes, 0=no limit) time_left - remaining time limit of a whole match (milliseconds) game_type - 0=opponent is human, 1=opponent is brain, 2=tournament, 3=network tournament rule - bitmask or sum of 1=exactly five in a row win, 2=continuous game, 4=renju evaluate - coordinates X,Y representing current position of the mouse cursor folder - folder for persistent files Information about time and memory limits is sent before the first move (after or before START command). Info time_left is sent before every move (before commands TURN, BEGIN and BOARD). The remaining time can be negative when the brain runs out of time. Remaining time is equal to 2147483647 if the time for a whole match is unlimited. The manager is required to send info time_left if the time is limited, so that the brain can ignore info timeout_match and only rely on info time_left. Time for a match is measured from creating a process to the end of a game (but not during opponent's turn). Time for a turn includes processing of all commands except initialization (commands START, RECTSTART, RESTART). Turn limit equal to zero means that the brain should play as fast as possible (eg count only a static evaluation and don't search possible moves).

INFO folder is used to determine a folder for files that are permanent. Because this folder is common for all brains and maybe other applications, the brain must create its own subfolder which name must be the same as the name of the brain. If the manager does not send INFO folder, then the brain cannot store permanent files.

Only debug versions should respond to INFO evaluate. For example, it can print evaluation of the square to some window. It cannot be written to the standard output. Release versions should just ignore INFO evaluate.

How should the brain behave when obtains unknown INFO command ?

How should behave the brain obtaining the unachievable INFO command? (for example too small memory limit)

Format of the command

INFO [key] [value]

Possible answers

none are expected ERROR [message]

31Nathan commented 1 year ago

https://github.com/JohanCDev/Gomoku/pull/22 Every thing is implement for in this PR