openrackem is a rack-sorting card game. Play against computer players, or online against other people.
openrackem is free, open source, and has no tracking.
How to play#
Rules#
- Each player has a rack of ten slots, numbered 5, 10, 15, and so on up to 50. Each slot holds one card, visible only to its owner.
- The deck has 40 cards for two players, 50 for three, and 60 for four.
- On your turn, draw the top card of the face-down stock or take the face-up discard. Put it in any slot. The card it replaces goes face up on the discard pile.
- A card taken from the discard pile must be placed. A card drawn from the stock can be thrown onto the discard pile instead.
- Get all ten cards in ascending order from slot 5 to slot 50 to go out and end the round. With two players, the rack must also contain a run of three consecutive numbers.
- When the stock runs out, the discard pile is turned over to form a new stock. After three of these in one round, the next time the stock runs out the round ends with no winner.
Scoring#
- The player who goes out scores 75.
- Every other player scores 5 for each card in ascending order starting from slot 5, stopping at the first card out of order.
- With Bonus Scoring on, the player who goes out also scores for the longest run of consecutive numbers in adjacent slots: 50 for three, 100 for four, 200 for five, 400 for six or more.
- The first player to reach the target score wins the match.
Options#
Set under Options in the menu.
| Option | Values |
|---|---|
| Name | The name other players see online |
| Players | 2, 3, or 4 |
| Difficulty | Easy, Normal, Hard, for the computer players |
| Bonus Scoring | On or Off |
| Partners | On or Off, four players only. Seats across from each other play as a team and add their scores |
| Play To | 250, 500, 750, or 1000 |
Playing online#
New Game plays against the computer. Play Online plays against other people. Phones, computers, and browsers all play at the same tables.
- Quick Match joins the next open table. The table starts with computer players in any empty seats.
- Create Table opens a private table with a room code to share. Join by Code enters one.
- Drawing and placing each have a 45-second clock. When it runs out, a computer player takes the seat until you return. A dropped connection gets its seat back on reconnect.
Controls#
Keyboard, on computers and in desktop browsers:
| Key | Action |
|---|---|
| S / Left | Draw from the stock |
| D / Right | Take the face-up discard |
| Up / Down | Move the rack cursor |
| Enter / Space | Place the held card, or confirm |
| X | Throw away a card drawn from the stock |
| Typing | Enter a name or a room code |
| Escape | Back to the menu. The game can be resumed |
| Alt+Enter | Toggle fullscreen |
Touch, on phones, tablets, and mobile browsers:
| Gesture | Action |
|---|---|
| Tap the stock or the discard pile | Draw |
| Tap a rack slot | Place the held card there |
| Tap the discard pile again | Throw away a card drawn from the stock |
| Two-finger tap | Back to the menu |
| Tap a menu row | Choose it |
Where to play#
- Browser: play it here, including online play. Nothing to install.
- iPhone: on the App Store. iOS 15 or later.
- Android: install the APK from the latest release. It is not on Google Play.
- Windows, macOS, Linux: download the archive for your system from the latest release.
Technical details#
Source code: github.com/dannyheskett/openrackem, MIT license.
Code#
- Written in C.
- The rules, the game state, and the computer players are platform-independent. Every platform uses them unchanged. Tests cover them and need no window.
- All randomness comes from one seeded generator, so a match replays exactly from its seed, its rules, and its list of moves.
- The computer players see only a redacted view of the game. They cannot see another rack, the order of the stock, or the seed.
- Drawing, input, and audio use raylib on Windows, macOS, Linux, Android, and the web. iOS uses its own Metal and UIKit backend with no raylib.
- Sound effects are synthesized at startup. There are no audio files.
- The browser version is the same C compiled to WebAssembly with Emscripten.
Online play#
- Play Online sends the server the player name you choose and your moves. The server holds your IP address in memory only to rate-limit new games. Its logs record each match’s room code, seed, moves, and scores, with no names or IP addresses.
- The server,
orserverd, is written in C. It runs matchmaking and holds the game state. It deals, enforces the rules, runs the turn clocks, and sends each player only what that player is allowed to see. - Clients connect over WebSocket. The WebSocket client is written for this project, with no third-party networking library. TLS comes from each platform: OpenSSL on Linux and Android, SChannel on Windows, Network.framework on Apple platforms, and the browser on the web.
- CI plays two-, three-, and four-player matches over a real socket against the server on every push, then deploys the server.
Layouts#
There are two renderers. Each build uses one.
- Landscape, on desktop: opponents on the left, your rack in the middle, and the stock, discard, held card, and scores on the right. The layout scales with the window.
- Portrait, on phones and tablets: fitted to the screen. Your rack fills the height, and the stock and discard sit in a band across the bottom.
The web build includes both. It picks portrait on a touch screen (pointer: coarse) and landscape otherwise.
Recording#
Desktop builds record the session to an H.264 MP4 file, one video frame per rendered frame, with no external tools. Turn on Record in the menu, or start with --record or --record <file>.mp4. Mobile and web builds do not include the recorder.
Builds and releases#
Every push to main builds and publishes a release: Linux x86-64, macOS universal, Windows x64 and x86, an Android APK, an iOS .ipa, and the WebAssembly bundle. The .ipa is the App Store build and cannot be sideloaded. Build instructions are in the README.