Gin Rummy Game
Build sets and suited runs, reduce deadwood, then decide when to knock. The complete hand, scoring and computer decisions run locally in your browser.
A complete Gin Rummy hand rather than a matching-card mini-game
Gin Rummy is a two-player draw-and-discard game built around a simple tension: every turn can improve your own combinations while also revealing information to the opponent. This specialist models a standard 52-card deck, ten-card hands, one face-up discard, a stock pile, legal draw and discard flow, meld optimization, knock decisions, Gin bonuses, layoffs and undercuts. The interface is driven by the same rules engine used by the verifier rather than by a separate visual approximation.
Sets and runs are evaluated together
A set contains three or four cards of the same rank. A run contains at least three consecutive cards in one suit. Aces are low, so Ace–2–3 is valid but Queen–King–Ace is not. A card cannot belong to two melds at the same time. That overlap rule matters in real hands, so the engine does not greedily accept the first obvious trio it sees. It enumerates valid meld candidates and selects a non-overlapping combination that minimizes the remaining deadwood points.
Deadwood uses the familiar point values
Cards outside the selected melds are deadwood. Aces count one point, numbered cards count their face value, and Jack, Queen and King count ten each. The game shows your current deadwood total continuously, but it does not expose the computer’s hidden hand. That makes the visible number useful for planning without turning the game into a solved-information exercise.
The opening upcard follows the two-player offer sequence
At the start of a hand, the non-dealer gets the first chance to take the face-up upcard. If the non-dealer passes, the dealer may take it. If both players pass, the non-dealer must draw from stock. This opening sequence is represented explicitly instead of silently forcing the first player into an ordinary draw turn. Dealer position alternates across hands in Match to 100.
A face-up pickup cannot be thrown straight back
When you take the top discard, that exact card must remain in your hand for the rest of the turn; you cannot immediately return it as your discard. The UI filters that action and the computer receives the same restriction. Stock draws do not have that limitation, so a stock card may be discarded immediately if it does not improve the hand.
Knock becomes available at ten deadwood or less
After discarding, a player with no more than ten deadwood points may knock. The app shows the option before the opponent receives another turn, which preserves the timing of the real decision. You may also continue instead of knocking. That choice can be strategically useful when the hand is strong enough to chase Gin, but waiting creates a risk that the opponent will knock first or undercut a weak knock later.
Gin means zero deadwood and earns a bonus
If all ten cards belong to melds after the discard, the hand is Gin. The knocker scores a 25-point Gin bonus plus the opponent’s deadwood. The defender is not allowed to lay off cards against Gin. The score panel reports the result directly so the player can see why a hand produced its point total rather than receiving an unexplained number.
Normal knocks allow the defender to lay off
Against an ordinary knock, the defender first forms the best melds in their own hand. Remaining deadwood may then be added to the knocker’s melds where legal: a matching rank can complete a three-card set, while consecutive suited cards can extend either end of a run. The local scorer searches those possible layoffs to find the defender’s lowest remaining deadwood instead of applying them in an arbitrary order.
An undercut punishes an early knock
After legal layoffs, if the defender’s deadwood is no higher than the knocker’s, the defender undercuts. The defender receives the difference plus a 25-point undercut bonus. This creates the central timing problem of Gin Rummy: getting under ten is not automatically a reason to knock. The interface presents the current deadwood but leaves that risk decision to the player.
The stock stopping rule prevents endless drawing
If the stock is reduced to two cards and the next player would need to draw from it, the hand ends without a score. The next hand can then start from a fresh deterministic deal. This avoids inventing a reshuffle rule that is not part of the standard two-player flow and also gives the verifier a clear finite boundary for long hands.
Easy, Standard and Hard use one legality model
All three computer levels receive the same legal actions. Easy keeps more seeded variation in draw and discard decisions. Standard focuses on immediate deadwood reduction. Hard uses the same local information but places more weight on keeping low deadwood and avoiding cards that appear especially helpful to a publicly observed opponent pickup. These are product difficulty settings, not claims of expert or tournament strength.
The computer never receives your hidden cards
The AI boundary is intentionally narrower than the full application state. It receives its own hand, the public discard pile, stock count, turn information, score, dealer and any face-up pickup that both players could observe. It does not receive the opponent’s hand or the unseen stock order. Independent QA calls the AI through that public view and verifies that every chosen discard is legal.
Practice seeds make deals reproducible
Opening Practice without a seed generates one and stabilizes it in the URL. The seed determines the deal and deterministic AI tie-breaks, so a refresh or same-seed reopen refers to the same underlying hand identity. Fresh Hand creates a different seed. Your draw and discard choices still determine the actual path through the hand, so the seed is a replay contract rather than a scripted result.
Hint and Undo are visible study assistance
Hint can recommend whether to take the discard or stock, suggest a discard, or advise whether to knock. Using it marks the hand Assisted. Undo restores a saved pre-decision state and also marks the hand Assisted. These tools are meant for learning combination recognition and timing, but their use is not hidden inside a “clean” result.
Daily Gin Rummy stays separate from Today’s 6
The date-stable Daily mode has its own hand identity, autosave, result history and streak. It does not insert Gin Rummy into the frozen Today’s 6 rotation and does not write a specialist result into the main `days` state. Cumulative QA protects that boundary alongside Shogi, Xiangqi, Go, Chess, Backgammon, Spades, Hearts and Letter Hive.
Local-first records without invented global rankings
Hands played, wins, clean wins, Gin results, undercuts, match wins, best hand points and Daily history stay in local browser storage. There is no account requirement, multiplayer rating pool or external Gin Rummy service behind the page, so the product does not invent a global rank, percentile or skill rating.
Strategy only, with no wagering mechanics
The deck is used only for a free browser strategy game. There are no wagers, chips, prizes, stakes, purchases or paid-random mechanics. The value comes from pattern recognition, probability-aware decisions, memory of public discards and learning when a low-deadwood hand is actually safe to knock.
Start with a Standard Practice Hand
Watch your deadwood, compare stock versus discard, and decide whether the first safe knock is really the best one.