AtomicChess.py is a console-based chess variant where any capture triggers an “explosion” that removes the captured piece, the capturing piece, and any adjacent non-pawn pieces. This mechanic transforms the standard strategy and game loop of chess into something much more explosive! 🧨
-
Variant Basics
- Captures cause an explosion on the board: both the victim and captor are removed, plus any surrounding non-pawn pieces.
- Kings cannot mutually explode; the first king removed loses.
-
Design & Implementation
I built the game in Python using object-oriented principles to keep the code modular and clear:- Controller (
ChessVar)
Manages turn order, console I/O, and overall game state. - Rule Engine (
RuleBook)
Encapsulates standard chess rules and atomic-specific logic (move validation, path clearance, blast-radius checks). - Board Model (
ChessBoard)
Represents the board as a list of dictionaries, executes moves and explosion logic, and renders an ASCII/Unicode board. - Piece Hierarchy
A baseChessPiecesclass withPawn,Rook,Knight,Bishop,Queen, andKingsubclasses, each overridingvalidate_piece_movefor piece-specific movement rules.
Core competencies demonstrated: inheritance & polymorphism, encapsulation, data-structure design (lists, dicts), error handling, and console-based UI.
- Controller (
- Run
ChessVar.pywith Python. - Players alternate turns by entering origin and destination squares (e.g.
e2 e4). - After each move, the board prints the updated state and any resulting explosion.
- The first player to eliminate the opponent’s king wins! 🏆
Built by Julio Diaz III (DevLo3) – Junior CS student at Oregon State University