A discord bot built with Go that allows two players to play tic-tac-toe by solving codeforces problems. Inspired by the bot NeoTLE, I wanted to create my own version of a codeforces duel bot in the form of tic-tac-toe games.
By challenging the other player alongside giving your handles, the bot will randomly choose 9 problems from the competitive programming platform Codeforces based on the the criteria specified (i.e. 2000 +constructive-algorithms +dp ~flows).
Then, by solving one of the 9 problems, the corresponding spot on the tictactoe board will be marked with your symbol (X or O). The game will end when three Xs or Os appear in the same row, same column or the same diagonal.
help: Display the help messageregistercodeforces_handle: Register a codeforces handle for yourselfhandle: Show your handlechallenge@opponentrating (optional)+tags (optional)~tags (optional): Challenge the@opponentto a tictactoe duel, with the given rating (leave empty for any rating), and criteria for tags included (+) and tags excluded (~)accept: Accept a challenge if you are being challengedend: End a challenge or an ongoing duelupdate: Update the current duel, which will update the board if the duelists solve more problems. Should be manually called from time to time.
Clone the repository. Make sure that you put your discord bot token in a .env file with the field name DISCORD_TOKEN.
Make sure that you have go1.23.4 or more. Then, go in the directory and just run
go run .