The chmengine module is an Easter egg component of
the ChessMoveHeatmap project. This module provides a chess engine
that uses the data produced by the heatmaps to pick moves and allows for playing or training the engines.
Below is an example of how to use the chmengine module to play a game against the CMHMEngine engine using
the PlayCMHMEngine class.
from chmengine import PlayCMHMEngine
# Initialize the PlayCMHMEngine
game_manager = PlayCMHMEngine(player_name="Phillyclause89")
# Play a game against the engine, CMHMEngine picks moves via various definite algorithms
# Use pick_by param to specify what arg gets passed to the CMHMEngine instance.
game_manager.play(pick_by="delta")Below is an example of how to use the chmengine module to play a game against the CMHMEngine2 engine using
the PlayCMHMEngine class.
from chmengine import PlayCMHMEngine, CMHMEngine2
# Initialize the PlayCMHMEngine
game_manager = PlayCMHMEngine(engine=CMHMEngine2, player_name="Phillyclause89", player_color='black')
# Cmhmey Jr. only has one pick_by algorithm that evolves through reinforcement learning updates
game_manager.play(pick_by="CMHMEngine2")Below is an example of how to use the chmengine module to train the CMHMEngine2 engine using the PlayCMHMEngine
class.
from chmengine import PlayCMHMEngine, CMHMEngine2
# Initialize the PlayCMHMEngine
game_manager = PlayCMHMEngine(engine=CMHMEngine2)
# Cmhmey Jr. only has one pick_by algorithm that evolves through reinforcement learning updates
game_manager.train_cmhmey_jr(training_games=1) # 1 training game is expected to take about ~45 minutes Click the image below to watch Cmhmey Jr. Train On YouTube!
This project is licensed under the MIT License. See the LICENSE file for details.
Feel free to adjust any sections as needed to better fit the specifics of your project!