Skip to content

dasshims/codenames_ai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Codenames Starter Code

A simplified Codenames implementation for interviewing purposes.

Note: This implementation only has one red team.

Setup

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-tk

macOS:

brew install python-tk

Running the Program

python3.12 -m src.main

Getting Started

When 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!

Your Task

Part 1: Core Game Logic

Implement the following functions in src/codenames.py:

  1. setup_game - Initialize the game board
  2. handle_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.

Part 2: AI Player

Implement the functions in src/algorithmic_player.py to create an AI player.

  1. get_spymaster_action - Generate a clue as the spymaster
  2. get_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

About

Typical codenames Game implemented using NLP

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages