A complete implementation of the classic board game Go, written in Go, available in both web and CLI versions.
- 9x9 board size
- Full Go rules implementation including:
- Stone capture mechanics
- Liberty detection
- Suicide rule prevention
- Pass system
- Two ways to play:
- Web Version: Beautiful browser-based UI with click-to-play interface
- CLI Version: Terminal-based with Unicode stones (● for Black, ○ for White)
go mod downloadRun the web server:
go run main.goThen open your browser and navigate to:
http://localhost:8080
The web version features:
- Visual board with click-to-play interface
- Beautiful gradient UI design
- Real-time game state updates
- Pass and reset buttons
- Responsive design for mobile devices
Run the terminal game:
go run go.go- The game starts with an empty 9x9 board
- Black plays first
- Click on any intersection to place a stone
- Click "Pass Turn" to skip your turn
- Click "New Game" to reset the board
- The game ends when both players pass consecutively
- The game starts with an empty 9x9 board
- Black plays first
- Enter moves in the format:
row col(e.g.,3 4) - Enter
passto pass your turn - Enter
quitto exit the game - The game ends when both players pass consecutively
- Stones are captured when they have no liberties (empty adjacent spaces)
- You cannot place a stone that would have no liberties (suicide rule)
- Players alternate turns between Black (●) and White (○)
- The game ends when both players pass
go build -o goapp-web main.goThen run:
./goapp-webOpen your browser to http://localhost:8080
go build -o goapp go.goThen run:
./goappGoApp/
├── main.go # Web server and API endpoints
├── go.go # CLI version
├── go.mod # Go module configuration
├── README.md # This file
├── .gitignore # Git ignore rules
└── static/ # Web assets
├── index.html # Web UI
├── styles.css # Styling
└── app.js # Client-side JavaScript