Gin Rummy is a game of small choices: which card to take, which to throw, and when to end the hand. The biggest one is when to knock. Knock too early and you get undercut. Wait too long and your opponent knocks first. This guide shows how to make each choice, with numbers from games played in Foony’s own Gin Rummy code, and how Foony’s bots play.
If you need the basics, read how to play Gin Rummy first. A quick reminder of three words used here:
- Melds are sets (3 or 4 cards of one rank) and runs (3 or more cards in a row, of one suit).
- Deadwood is every card in your hand that isn’t in a meld. Face cards count 10, aces 1, other cards their number.
- Knocking ends the hand. On Foony, in the standard game, you can knock when your deadwood is 10 or less.
When to knock
When you knock, your opponent lays out their melds and can add their loose cards to your melds. Then you compare deadwood.
- If your deadwood is lower, you score the difference.
- If theirs is the same or lower, that’s an undercut. They score the difference plus 25.
- If you knock with 0 deadwood, that’s gin. You score their deadwood plus 25, and they can’t add cards to your melds.
A worked undercut
We scored this hand with Foony’s own scoring code. Your opponent knocks with the 7, 8, and 9 of hearts, three 4s, and the jack, queen, and king of clubs. Their one loose card is the 8 of diamonds, so their deadwood is 8.
You hold three 5s, the 10, jack, and queen of spades, and four low cards: the ace of diamonds, the ace of clubs, the 2 of diamonds, and the 2 of spades. None of those fits on their melds. Your deadwood is 1 + 1 + 2 + 2 = 6.
6 is lower than 8, so it’s an undercut. You score 25 + (8 - 6) = 27 points.
If your four loose cards had been the ace and king of diamonds, the 2 of diamonds, and the 9 of spades, the 9 would join your 10-J-Q of spades. Your deadwood would be 1 + 10 + 2 = 13, and they’d score 13 - 8 = 5.
Against people: knock early
Against a player who keeps a low hand, knocking early is usually right. Each turn you wait, they may get closer to gin or to a count that undercuts you.
Against Foony’s Expert bot: wait
Foony’s Expert bot knocks the moment it can. In games between two Expert bots, the knocker’s deadwood was 7.0 on average. That’s a high count to knock with, and a player with a low hand undercuts it.
We played 40,000 hands for each of these rules against the Expert bot, twice. In each test, one seat played exactly like the Expert bot, except for when it knocked:
| Your rule | Points per hand against the bot |
|---|---|
| Knock at 10 or less (same as the bot) | about 0 |
| Knock at 7 or less | about 0 |
| Knock at 5 or less | +0.7 to +0.8 |
| Knock at 3 or less | +1.5 to +2.0 |
| Gin only | +3.6 to +3.9 |
The table shows the range of the two runs. The first two rows are a tie with the bot. With the “gin only” rule, the bot knocked first in most hands, and in 31% of all hands its knock was undercut. That’s where most of the extra points came from.
So against the Expert bot, keep building melds and keep your loose cards low. Knock when your deadwood is 3 or less, or go for gin.
What to discard
Throw high loose cards first. A king you can’t use costs 10 if the other player knocks. A 2 costs 2. Early in the hand, a lone face card is usually the right discard.
Keep cards that are one away from a meld. Two 9s need one more 9. A 5 and 6 of hearts need a 4 or 7 of hearts. These pairs are how you get to gin.
When you’re stuck between two discards, throw the higher one. Foony’s bots break ties the same way. The deadwood you hold next turn is the same, and you risk less if the other player knocks now.
Watch what your opponent takes. A player who takes a discard is collecting that rank or that run. If they take the 7 of clubs, don’t throw them another 7, or the 6 or 8 of clubs.
Watch what they throw. A player who throws the jack of spades probably isn’t collecting jacks. Other jacks are safer to throw them.
Taking from the discard pile
Take the top discard only when it goes into a meld. If you take it for any other reason, your opponent sees what you want and you gain nothing. Foony’s Expert bot follows this rule exactly. So when an Expert bot takes a discard, you know it just made a meld with it.
Oklahoma Gin
In Oklahoma Gin, the first face-up card sets the knock limit for the hand. A 7 means you can knock at 7 or less. A face card means 10, and an ace means you need gin. Look at that first card before you plan. With a low limit, aim for gin from the start.
How to beat Foony’s Gin Rummy bots
The host picks one level for every bot:
| Level | How often a choice is random |
|---|---|
| Easy | Every draw and discard |
| Casual | About 60% |
| Skilled (default) | About 30% |
| Expert | Never |
Every level knocks when its discard leaves 10 or less, so even Easy ends hands. What the bots do, from the bot code:
- They knock as soon as they can. That’s the biggest thing to use. Keep a low hand and you’ll undercut them often.
- They take a discard only to make a meld. If a bot takes a card, don’t throw it cards that fit with it.
- They discard the card that leaves the least deadwood. They don’t think about what you’re collecting, so they’ll throw you the card you need.
- They don’t remember which cards you’ve taken or passed. They won’t hold a card back to block you.
Ready to try? Play Gin Rummy against an Expert bot and see how often you can undercut it.
The test hands were played on 2026-11-20 with Foony’s own Gin Rummy code and its Expert bot, standard rules, knock at 10.