A simplified Codenames implementation for interviewing purposes.
Note: This implementation only has one red team.
tkinter cannot be installed through pip, it must be installed globally on your system. This project is configured for Python 3.12.
Ubuntu/Debian:
sudo apt-get install python3-tkmacOS:
brew install python-tkpython3.12 -m src.mainWhen you first run the program, you'll see an uninitialized board with all "quiet" squares. Try giving a hint and clue, then click on a card as the operative — it will error. This is expected!
Implement the following functions in src/codenames.py:
setup_game- Initialize the game boardhandle_reveal_card- Handle card reveal logic when operative clicks
Note: Treat board_gui.py as a blackbox — you don't need to modify or understand it.
Implement the functions in src/algorithmic_player.py to create an AI player.
get_spymaster_action- Generate a clue as the spymasterget_operative_action- Select a card as the operative
If you want to use the provided get_english_words(), create a virtual environment and install requirements:
python3.12 -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
pip install -r requirements.txt