Othello Board Game with Gymnasium compliant interface

The repository at https://github.com/pghedini/OthelloGymnasium contains an implementation of OTHELLO – often also called REVERSI – with OpenAI Gymnasium interfaces. The environment is for researchers and engineers who are interested in developing model-based Artificial Intelligence Reinforced Learning algorithms.

To use the package in Interactive mode, follow these steps:

import gymnasium
import othello_ai
env = gymnasium.make('othello_ai/Othello-v0', render_mode='ansi', board_size=6)
# if you choose 'human' render_mode, use env.render() to display board 
# start a new game
env.reset()
#
# env.render() # to eventually display board
#
# get the color next to move
next_move = lambda x: "BLACK" if x == -1 else "WHITE"
next_move(env.unwrapped.player_turn)
# get possible moves
env.unwrapped.get_possible_moves
# move
env.step(8)
# get the color next to move
next_move(env.unwrapped.player_turn)
# get possible moves
env.unwrapped.get_possible_moves
# move
env.step(7)
# move till the game end...
# ...
# close the env when finished
env.close()