Skip to content

cutalion/tic-tac-chec

Repository files navigation

Chess Tic-Tac-Toe (Tic Tac Chec)

A pet project to learn Go — a hybrid board game combining chess piece movement with tic-tac-toe win conditions. This is not vibe-coded: I write all the Go code myself, using Claude Code's Learning output style which explains concepts and guides decisions rather than generating code for you.

Rules

  • 4×4 board, 2 players: White and Black
  • Each player has 4 pieces: Pawn, Rook, Bishop, Knight
  • On your turn: place a piece from hand onto any empty cell, or move a piece already on the board (chess-style movement)
  • Capturing a piece returns it to its owner's hand (shogi-style)
  • Pawns reverse direction when reaching the far edge
  • Win: get 4 of your pieces in a row — horizontal, vertical, or diagonal

Example

Gameplay

How to Run

go run ./cmd/tui/

Play Online

SSH play demo

Connect via SSH — no install needed:

ssh tramway.proxy.rlwy.net -p 17014

You'll be paired with the next player who connects. Features:

  • Auto-pairing lobby
  • Turn indicator and board flip (Black sees the board from their side)
  • In-game rules screen (?)

Self-Hosting

Run the SSH server with Docker:

docker build -t tic-tac-chec .
docker run -p 2222:2222 tic-tac-chec

Players connect with ssh localhost -p 2222.

To keep the host key stable across redeploys, set the HOST_KEY_PEM env var to an Ed25519 private key in PEM format:

ssh-keygen -t ed25519 -f host_key -N "" && rm host_key.pub
docker run -p 2222:2222 -e HOST_KEY_PEM="$(cat host_key)" tic-tac-chec

Without HOST_KEY_PEM, keys are auto-generated on startup (clients will see a host key change warning after each redeploy).

Claude Code Skill

Play against Claude in your terminal using the Claude Code skill.

Skill demo

How it works

The skill teaches Claude to play the game through a CLI binary. On each turn, Claude runs tic-tac-chec-cli move to make moves and reads the board output to decide its next action. You communicate moves in natural language ("pawn to b3") and Claude translates them into CLI commands.

When Claude loses, it performs a post-game analysis: reconstructs the game move-by-move, identifies where it went wrong, and writes a concrete lesson to the "Lessons Learned" section of its skill file (~/.claude/skills/play-tic-tac-chec/SKILL.md). If the same lesson appears three times, it gets promoted into the main Strategy section. Over time, Claude builds a personalized playbook from its failures.

Requirements

Install

make install-skill

Then restart Claude Code and say /play-tic-tac-chec.

Controls

Key Action
↑ ↓ ← → / h j k l Move cursor
Enter / Space Select piece / confirm move
? Rules screen
N New game (after game over)
C Cycle color scheme
S Toggle status overlay
Q Quit

About

Tic-Tac-Toe x Chess game

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors