This project implements Ultimate Tic-Tac-Toe in the Effekt programming language. The game is a complex variant of traditional Tic-Tac-Toe played on a 3x3 grid of smaller Tic-Tac-Toe boards, featuring both local multiplayer and AI opponent modes.
- Defines fundamental data types and structures
- Core type definitions:
Cell: Board cell states (Empty, Active, Nought, Cross, Draw)GameMode: Game mode types (Local, Computer)GameBoard: Composite type containing BigBoard and SmallCopySmallBoard: Single 3x3 board representationBigBoard: Collection of nine SmallBoardsFinish: Game state tracking (isFinished, state, player)
- Effect definitions:
WrongInputExitGamePrintHelp
- Utility functions and constants
- Implements main game loop and control flow
- Key functionalities:
- Game mode selection (Local/Computer)
- Difficulty level selection (Easy/Medium/Hard)
- Player side selection (X/O)
- Turn management
- Input validation
- Game state transitions
- Win condition verification
- User interaction handling
- Manages board state creation and modifications
- Core functionalities:
- Initial board generation
- Board state updates
- Cell activation/deactivation
- Win condition checking
- Board state validation
- Victory pattern detection
- Implements computer player logic
- Features:
- Multiple difficulty levels
- Minimax algorithm implementation
- Position evaluation
- Strategic move selection
- Win/block detection
- Optimization strategies:
- Position scoring
- Depth-limited search
- Move prioritization
- Handles all visual output
- Components:
- Board visualization
- Game state display
- Welcome screen
- Exit screen
- Rules display
- Color-coded UI elements
- Console-based interface
- Application entry point
- Game initialization
- Game initialization from
main.effekt - Game mode and settings selection
- Main game loop (
game.effekt):- Input processing
- State validation
- Board updates
- AI moves (if applicable)
- Visual feedback
- State management through
generate.effekt - AI processing via
opponent.effekt - Visual output through
render.effekt
WrongInput: Input validation errorsExitGame: Game terminationPrintHelp: Help system accessOutOfBounds: Array bounds checking
- Input validation
- Error recovery
- Game state management
- Visual feedback
Comprehensive test suite (src/test.effekt) covering:
- Cell representation
- Board initialization
- State management
- Move validation
- Win detection
- AI logic
- Difficulty levels
- Edge cases
- Effekt programming language
- Console-based interface
- ANSI color support
- Standard input/output handling
- Enhanced AI strategies
- Network multiplayer
- Game state persistence
- Statistics tracking
- Advanced difficulty levels
- Replay system
- Tutorial mode
- Configuration options
- Type safety first
- Effect system for error handling
- Pure functions where possible
- Clear separation of concerns
- Comprehensive testing
- Modular design
- Documentation maintenance