For playing scrabble in the terminal (and offline!) because I want to see if I can make this. Modelled after my chess engine project, something for me to play on flights.
Word list used: CSW24.txt (CSW2024 lexicon) from https://scrabble.org.nz/resources/internet-resources-and-word-lists/
- Clone the repository
- Ensure you have Python 3 installed
- Run the game using the command: 'python cli.py'
- Type 'q' to exit game
Here are the standard rules and setup for English-language Scrabble (the classic 15×15 board game).
What’s in the box (standard English Scrabble) • Board: 15×15 grid (225 squares), with premium scoring squares. • Tiles: 100 tiles total • 98 letter tiles • 2 blank tiles (wild, score 0) • Tile racks: each player uses a rack that holds 7 tiles. • Tile bag to draw from.
Board setup (15×15) • The board has premium squares: • Double Letter Score (DL) • Triple Letter Score (TL) • Double Word Score (DW) — includes the center star • Triple Word Score (TW) • Premium squares are arranged in a symmetric pattern. • The center star is a Double Word Score. • First move must cover the center star.
(Counts on the standard board are commonly given as: 8 TW, 17 DW, 12 TL, 24 DL.)
Letter tiles: distribution and points (English)
Counts (how many of each tile): A×9, B×2, C×2, D×4, E×12, F×2, G×3, H×2, I×9, J×1, K×1, L×4, M×2, N×6, O×8, P×2, Q×1, R×6, S×4, T×6, U×4, V×2, W×2, X×1, Y×2, Z×1, Blanks×2
Point values: A1, B3, C3, D2, E1, F4, G2, H4, I1, J8, K5, L1, M3, N1, O1, P3, Q10, R1, S1, T1, U1, V4, W4, X8, Y4, Z10, Blank0
Basic setup 1. Put all tiles in the bag and mix. 2. Each player draws 1 tile; highest letter goes first (blank usually counts as lowest). Return tiles to the bag and remix. 3. Each player draws 7 tiles to their rack. 4. Player 1 plays first.
How a turn works
On your turn you may do one of these: 1. Play tiles to form a word (and score). 2. Exchange 1–7 tiles (only if at least 7 tiles remain in the bag). You lose your turn. 3. Pass (score nothing).
After playing tiles or exchanging, refill your rack to 7 from the bag (as available).
What makes a legal play • Words must read left-to-right (horizontal) or top-to-bottom (vertical). • Tiles placed in a turn must form one continuous line (all in one row or one column). • All plays after the first must connect to the existing tiles on the board. • Any new tiles that create additional words (cross-words) must make valid words too. • No diagonal words. • Blanks: when played, you declare what letter it represents; it stays that letter for the rest of the game and is worth 0 points.
Scoring • Add the point values of letters in each word you form. • Letter premiums (DL/TL) apply only to newly placed tiles on those squares. • Word premiums (DW/TW) multiply the entire word’s score (after letter bonuses). If a word covers multiple word premiums in one play, the multipliers stack (e.g., DW + TW = ×6). • You score all words formed in your turn (main word plus any cross-words). • Bingo bonus: If you use all 7 tiles from your rack in one turn, add 50 points.
Challenging words
This depends on the ruleset being used (casual vs. tournament). Common “official/tournament-style” handling: • A challenged word that’s acceptable stays; challenger may lose their turn (or be penalized, depending on the specific rules in use). • A challenged word that’s unacceptable is removed and the play is undone; the player loses their turn.
(Home games often use simpler “look it up and take it back” rules.)
How the game ends
The game ends when: • A player uses their last tile and there are no tiles left in the bag, or • All players pass consecutively (commonly three passes in a row per player set, depending on house rules).
Endgame scoring (standard): • Each player subtracts the value of tiles left on their rack from their score. • If someone went out, they add the total of everyone else’s unplayed tile points to their score.