The deadwood count is the sum of the point values of the deadwood cards-aces are scored at 1 point, face cards at 10, and others according to their numerical values. A hand can contain three or fewer melds to knock or form legal gin. A player can form any combination of melds within their hand, whether it contains all sets, all runs, or a mix of both. Aces are considered low-they can form a set with other aces but only the low end of runs (A♠ 2♠ 3♠ is a legal run but Q♠ K♠ A♠ is not). Deadwood cards are those not in any meld. 8♥ 8♦ 8♠ and runs of 3 or more cards in sequence, of the same suit. Gin has two types of meld: Sets of 3 or 4 cards sharing the same rank, e.g.
The basic game strategy is to improve one's hand by forming melds and eliminating deadwood. The objective in gin rummy is to score points and reach an agreed number of points or more, usually 100, before the opponent does. Work in progress! Bot's decisions are for now random.