A beautiful and feature-rich command-line chess game implemented in Go. Play chess with a friend in your terminal with support for time controls, game saving, and more!
- Interactive command-line interface
- Unicode chess pieces (with ASCII fallback)
- Time control with increment
- Game save/load functionality
- Player names support
- Comprehensive test coverage
# Install the game
go install github.com/klejdi94/chess-go/cmd/chess@latest
# Start a new game
chess
# Start with custom settings
chess -player1 "Alice" -player2 "Bob" # Set player names
chess -save "game.json" # Save game to file
chess -load "game.json" # Load game from file
chess -time "5,3" # 5 minutes + 3 seconds increment
chess -no-timer # Disable time control
The game supports chess clocks with increment:
- Each player starts with a main time bank (default: 10 minutes)
- After each move, the player gets additional time (default: 5 seconds)
- The clock shows remaining time for the current player
- A player loses if their time runs out
Example time controls:
chess -time "3,2" # 3 minutes + 2 seconds per move
chess -time "5,0" # 5 minutes with no increment
chess -time "15,10" # 15 minutes + 10 seconds per move
chess -no-timer # Disable time control
During the game, you can use these commands:
- Move pieces using algebraic notation (e.g.,
e2e4
,Nf3
) - Type
quit
to exit the game - Type
save
to save the current game - Type
help
to see all commands
Completed:
- Basic chess rules and movement
- Game save/load functionality
- Player names support
- Time control with increment
- Clear and intuitive interface
- Comprehensive test coverage
Planned:
- PGN notation support
- AI opponent
- Network play
- Undo/redo functionality
- Game analysis tools
- Tournament mode
Contributions are welcome! Feel free to:
- Fork the repository
- Create a feature branch
- Submit a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.