Blokus-AI is an implementation of the Blokus board game environment using the Gymnasium framework. This environment is designed to be used for training AI agents to play Blokus.
import blokus_env
import gymnasium as gym
# Create the environment
env = gym.make("BlokusEnv-v0", render_mode="human")
# Reset the environment
obs, _ = env.reset()
done = False
while not done:
# Take a random action
action = env.action_space.sample()
obs, reward, term, trunc, info = env.step(action)
done = term or trunc
# Render the environment
env.render()
To set up the environment, follow these steps:
conda create -n blokus python=3.8
conda activate blokus
pip install -r requirements.txt
pip install -e .
Contributions are welcome! Please feel free to submit a Pull Request or open an issue.
If you use Blokus-AI in your research, please cite it as follows:
@misc{blokus-ai,
author = {Roger Creus Castanyer},
title = {Blokus-AI: A Gymnasium Environment for the Blokus Board Game},
year = {2024},
}