A multiplayer competitive word-block game where players race to form words from randomly generated blocks.
WordTris combines Tetris-style block placement with word formation. Each player has their own 10×20 board and competes to form words before their board fills up. The player with the highest score when the game ends wins.
- Multiplayer: Up to 8 players per room
- Competitive: Each player has their own board, same block sequence
- Word Lists: Multiple word list support, host selects
- Real-time: WebSocket-based updates
- Smart Block Generation: Characters weighted by n-gram frequency
- Create a room or join an existing one with a room code
- The host selects a word list and clicks "Start Game"
- Place blocks on your board to form words
- Words can be horizontal or vertical, in either direction
- Form words from the selected word list to remove blocks and score points
- Last player standing with the highest score wins
# Clone the repository
git clone <repository-url>
cd wordtris
# Create wordlists directory and add word lists
mkdir wordlists
# Add word list files (one word per line, lowercase)
# Example: echo "hello" > wordlists/english.txt
# Run the server
go run main.goThe server expects word list files in the ./wordlists/ directory:
wordlists/
├── english.txt # One word per line
├── medical.txt
└── ...
Use 6-character alphanumeric codes to join rooms.
wordtris/
├── main.go # Entry point
├── internal/
│ ├── wordfreq/ # Word list loading, trie, frequencies
│ ├── room/ # Room management
│ ├── game/ # Game logic, board, blocks
│ └── ws/ # WebSocket handling
├── templates/ # HTML templates
└── static/ # CSS
- Backend: Go
- Frontend: Go HTML templates
- Real-time: WebSocket
- Data Structures: Trie for word lookup, n-gram frequency for block generation
| Method | Path | Description |
|---|---|---|
GET |
/ |
Lobby page |
GET |
/game?room=CODE |
Game page |
GET |
/api/wordlists |
List available word lists |
See SPEC.md for full WebSocket protocol specification.
| Word Length | Points |
|---|---|
| 2-3 chars | 100 × length |
| 4-5 chars | 150 × length |
| 6+ chars | 200 × length |
MIT