Quick Play is the standard ranked mode for 21 Duel. It is designed for speed and instant settlement.
Format: Single Round (Sudden Death).
Stakes: 100, 200, 500, or 1,000 Tokens.
Objective: Win the round to claim the entire pot (minus the 2.5% Burn Tax).
1. The Coin Toss (True Randomness)
In a single-round match, going first or second is a tactical factor. We do not use a pseudo-random generator. We use cryptographically secure randomness provided by the OS itself to determine the starting player.
The Code (Verification):
We use Python's secrets library, which is designed for cryptography, not just general randomization.
21 Duel is not just about luck; it is about reading your opponent. To maintain the skill gap, we enforce a "Fog of War" protocol.
You See: Both of your cards.
Opponent Sees: Only ONE of your cards.
The Server: Hides the second card and the total score from the opponent's device entirely.
Anti-Cheat Security:
Unlike web games where you can "Inspect Element" to see hidden data, our server does not send the hidden card to the client until the round is over. It is physically impossible to cheat.
The Code (Fog of War Protocol):
3. Tie Game (Push)
If both players stand on the same number (e.g., both have 19), or both players bust, the protocol declares a PUSH.
Result: 100% of the stake is returned to both players.
# From bot.py - _broadcast_pvp_update
if gs['status'] not in ['game_over', 'round_over']:
# HIDE CARDS: The server replaces the 2nd card with "??"
payload["opponent_hand"] = [str(gs["players"][opponent_id]["hand"][0])] + (
['??'] * (len(gs["players"][opponent_id]["hand"]) - 1)
)
# HIDE SCORE: The server sends a question mark, not the value.
payload["opponent_score"] = '?'