| Crates.io | game24_net |
| lib.rs | game24_net |
| version | 0.2.2 |
| created_at | 2025-12-31 09:05:16.933219+00 |
| updated_at | 2026-01-08 07:25:37.105213+00 |
| description | A multiplayer, real-time '24 Game' built in Rust with TCP server/client. Fully plain-text terminal compatible; no ANSI colors or emojis. |
| homepage | |
| repository | |
| max_upload_size | |
| id | 2014308 |
| size | 51,114 |
A multiplayer, terminal-based implementation of the classic 24 Game logic puzzle, written in Rust. This project features a TCP client-server architecture, allowing multiple players to compete simultaneously in real-time using a clean Text User Interface (TUI).
The objective is simple: given four randomly generated numbers, use arithmetic operations to calculate the value 24.
Players compete in a shared lobby. The first player to submit a valid expression that equals 24 wins the round and gains a point.
Addition (+)
Subtraction (-)
Multiplication (*)
Division (/)
Exponentiation/Power (^)
Parentheses () for grouping.
You must use all four numbers provided.
You must use each number exactly once.
You can use the operators as many times as needed.
The input system is designed for speed and convenience in a terminal environment.
| Key / Input | Action |
|---|---|
| Number Keys | Input numbers (0-9) |
| Operators | Input +, -, *, / |
. (Dot) |
Auto-Bracket: Wraps your entire current expression in parentheses (...) and moves the cursor to the end. |
↑ (Up Arrow) |
Power: Inserts the exponentiation symbol ^. |
| Delete or PageUp | Power: Insert (. |
| PageDown | Power: Insert ). |
| Enter | Submit your answer or command. |
| Esc | Quit the game client. |
Type these into the input bar:
/start - Start the game (if currently waiting)./pass - Vote to skip the current difficult puzzle./score - Check your current score./players - List all connected players and their scores./help - Show the help menu.cargo build --release
Start the game server. You can specify the number of rounds and the port.
# Syntax: cargo run -- server [rounds] [IP:Port]
# Example (Start 10 rounds on default port):
cargo run -- server
# Example (Start 20 rounds on specific port):
cargo run -- server 20 0.0.0.0:7878
Connect to the server. Open a new terminal window for each player.
# Syntax: cargo run -- client <Nickname> <IP:Port>
cargo run -- client Alice 127.0.0.1:7878
cargo run -- client Bob 127.0.0.1:7878
Server gives numbers: 3, 3, 8, 8
Player Input:
8 / ( 3 - 8 / 3 )
Result:
Using Special Controls:
If you have typed 2+2 and want to multiply the result by 6:
2+2. (Dot) -> Becomes (2+2)*6 -> Becomes (2+2)*6 -> 24.This project is open-source. Feel free to fork and modify!