Skip to main content

Questions tagged [card-games]

For challenges which involve card games. This includes playing the game, implementing the game, as well as challenges concerned with individual mechanics and analysis of the game (for instance, computing probabilities of certain events).

Filter by
Sorted by
Tagged with
3 votes
1 answer
136 views

Detect revokes in Jass

Jass is a trick-taking game for four players and the national card game of Switzerland. It is played with a 36-card deck, four suits each with ranks 6, 7, 8, 9, 10, J, Q, K, A. We will be using French ...
Parcly Taxel's user avatar
  • 3,935
3 votes
1 answer
184 views

Determine the optimal blackjack move

After the success of my baccarat challenge, I figured we should try a similar challenge for another casino game, blackjack. Blackjack is a game played with two to eight decks of cards shuffled ...
Purple P's user avatar
  • 1,677
11 votes
8 answers
3k views

Should the banker hit?

Baccarat is a casino game where gamblers bet on whether one of two hands, the player or the banker, will have a sum closer to 9 (mod 10) or whether they will tie. It is played with four to eight ...
Purple P's user avatar
  • 1,677
-10 votes
1 answer
416 views

Bingo Cards PDF

Write code to generate a PDF file containing 6 bingo cards. Winner is the one that uses the shortest code and needs no actions except for installing a library and running the code. (No Save As PDF). ...
paki eng's user avatar
  • 175
7 votes
1 answer
253 views

Determine if a Spider Solitaire game is stale

Let's introduce a simplified variant of the well known Spider Solitaire. From Wikipedia: The main purpose of the game is to remove all cards from the table, assembling them in the tableau before ...
Kamila Szewczyk's user avatar
14 votes
13 answers
3k views

Play a game of memory

Playing the game of memory against a machine is highly unfair, because they play almost as good as small children. So let's make the machine play alone, but in a fair way: Input: 1...26 pairs of ...
Philippos's user avatar
  • 2,660
2 votes
1 answer
399 views

King of the Cards

King of the Cards Code available here! In this King of the Hill challenge, you must write a bot that can play Crazy Eights. This is a card game often played by children, in which the objective is to ...
Ginger's user avatar
  • 5,790
13 votes
9 answers
2k views

Magic: the Gathering - Colour Sorting

Related: Deck Names Friends or Foes Paying for Spells The Magic: the Gathering card game has five colours of magical mana: white (W), blue (U), black (B), red (R), and green (G). Cards can be any of ...
Matthew Jensen's user avatar
3 votes
0 answers
191 views

Calculate the probability of getting this hand in n tries [closed]

Imagine there is a card game where the primary objective of the game is to get 4 of one card in your hand. Game mechanics Each player starts of with 10 cards in their hand. The remaining 32 cards (...
violetorigin's user avatar
7 votes
1 answer
326 views

Heart Point Generator

It's mentioned last time that, in Hearts, Each round every player gets a non-negative amount of points. The sum of the points is 26, and at least one player gets 13 or more points. Actually, it's ...
l4m2's user avatar
  • 26.2k
10 votes
4 answers
295 views

Is it a possible Hearts result?

Hearts is a 4-player game that uses the following scoring rules: Everyone starts with score 0. Each round every player gets a non-negative amount of points. The sum of the points is 26, and at least ...
l4m2's user avatar
  • 26.2k
14 votes
3 answers
771 views

Snap (card game)

When I was a child I used to play a variation of Snap to stake soccer trading cards. "Game" is an overstatement because the only role of the players is to secretly prepare their starting ...
Domenico's user avatar
  • 2,333
1 vote
0 answers
308 views

FreeCell stack moving

This question is about moving stacks around in the card game FreeCell, but here it will be presented more abstractly. Given three integers \$0\le n,m<10000,0<k<10000\$. There are \$m+2\$ ...
l4m2's user avatar
  • 26.2k
9 votes
3 answers
522 views

Turn-based RPS Poker

This is a two-player card game which resembles a vastly simplified game of Texas Hold'em, combined with RPS (rock-paper-scissors) and the most basic mechanic of commercial turn-based card games. The ...
Bubbler's user avatar
  • 78.2k
6 votes
6 answers
973 views

Let's play Judgement!

In this king-of-the-hill challenge, you will be making a python 3 bot to play the card game judgement! Sandbox Rules Judgement is a hand based game similar to games like rummy. In each round, 7 cards ...
Rushabh Mehta's user avatar
15 votes
15 answers
2k views

How many Faro shuffles for a cycle?

Background Inspired by this video by Matt Parker A Faro shuffle is a perfect riffle shuffle where the deck is exactly interleaved with its other half. This is how to perform one: the deck of 52 cards ...
pxeger's user avatar
  • 24.3k
12 votes
2 answers
420 views

One-card Poker for Two

This is a challenge to write bots to play the 1st and 2nd players in the following simple poker game. Rules of the poker game There are two players, A and B. Each antes $10 into the pot, and is dealt ...
Rosie F's user avatar
  • 417
3 votes
1 answer
227 views

Check if hand from card game "Rooster" is valid for the second stage

Here in Russia, we have a little-known card game with the name, when translated directly, means Rooster. The cards used are two full 54-card decks of playing cards from 2 through aces, with jokers. ...
Dion's user avatar
  • 3,950
7 votes
3 answers
374 views

Recreate a simplified version of the card game L.L.A.M.A

In LLAMA, you want to dump cards from your hand as quickly as you can, but you might not be able to play what you want. Each player starts a round with six cards in hand; the deck consists of llama ...
RollingCompass's user avatar
4 votes
1 answer
409 views

Challenge: Functioning Blackjack Game [closed]

This is kept fairly original: Write a program that creates a standard blackjack game: input "h" means hit or draw another card input "s" means stand, or take what you have already Rules: cards ...
DudeWhoWantsToLearn's user avatar
10 votes
2 answers
617 views

Play Big 2 by yourself, as fast as you can

Introduction Big 2 is a card game popular in East Asia and South East Asia, in which 4 players are dealt 13 cards each (ie, an equal division of a standard deck without jokers). The goal is to empty ...
aphrid's user avatar
  • 201
30 votes
13 answers
4k views

20 cards with no Set

Background Set is a card game. The deck consists of 81 unique cards that vary in four features: number of shapes (one, two, or three), shape (diamond, squiggle, oval), shading (solid, striped, or ...
Bubbler's user avatar
  • 78.2k
2 votes
0 answers
70 views

Play the card game "Set" [duplicate]

"Set" is a card game played with a deck of 81 cards, twelve of which are pictured below: Each card has four attributes, each of which may assume three values: Number: the number of symbols, either 1,...
jnfnt's user avatar
  • 383
15 votes
9 answers
1k views

What is the score of my Scopa hand?

I like card game challenges so I made this one for the Italian card game Scopa. My family has been playing this game since time immemorial. It has a very interesting scoring system that should be fun ...
qdread's user avatar
  • 509
11 votes
2 answers
329 views

Is this a valid Tichu play?

Tichu is a card game in which players take turn playing sets of cards from a deck consisting of a standard 52-card deck, plus 4 additional cards: the dragon, which has a greater value than any other ...
Doorknob's user avatar
  • 71.6k
10 votes
9 answers
744 views

Golf (6-card) Golf!

Golf Golf! This is my first challenge, so please be gentle! The challenge is to write a program that will output the correct score for a layout in the card game "Golf." The card game Golf has many ...
qdread's user avatar
  • 509
17 votes
8 answers
2k views

Stage a Coup to become king of the hill!

Leaderboard ...
Purple P's user avatar
  • 1,677
32 votes
11 answers
2k views

Nothing like a good ol' game of ModTen

Disclaimer: ModTen is a fictional card game which was created for the sole purpose of this challenge. The rules of ModTen ModTen is played with a standard 52-card deck. Because the full rules are ...
Arnauld's user avatar
  • 195k
15 votes
14 answers
2k views

Irish Snap: Variant Rules

Introduction Recently, me and a couple of my friends decided to play some cards, and one of them suggested the game 'Irish Snap', which was the inspiration for this challenge. However, I later learnt ...
EdgyNerd's user avatar
  • 1,376
14 votes
5 answers
567 views

Professor at MIT needs an AP!

The 5-card magic trick involves a magician whose assistant gives them 4 shown cards and a hidden one, in this order, and the magician must guess the hidden one. WARNING: Solution below! Leave now or ...
Erik the Outgolfer's user avatar
1 vote
2 answers
249 views

Accordion Solitaire: Which First Moves Can I Make?

Introduction: Unfortunately an Accordion Solitaire Solver challenge already exists (Solve a game of Accordion), so instead this easier related challenge. Let's start by explaining how Accordion ...
Kevin Cruijssen's user avatar
6 votes
3 answers
222 views

Scoring Chinese Hearts

Chinese Hearts, also known as Gong Zhu (拱猪, Chase the Pig), is a variance of the Hearts game. It is a 4 player card game with the aim to earn the highest amount of points. You may read more about it ...
tsh's user avatar
  • 35k
5 votes
4 answers
688 views

Russian BS - Submissions accepted until October 13th

The ChatRoom is here I love playing the card game BS, but sometimes, it just doesn't have enough oomph for my short attention span. Instead, let's play some Russian BS. Rules Here is a quick guide ...
Rushabh Mehta's user avatar
3 votes
6 answers
411 views

Let's Play some ProSet! [duplicate]

ProSet is a classic card game that is played normally with 63 cards. One card has 6 colored dots on it, like below The rest of the cards are missing some of these 6 dots, but each card has at least 1 ...
Rushabh Mehta's user avatar
5 votes
2 answers
399 views

Bridge Deal Scoring

Goal Given a deal result from Duplicate Contract Bridge, calculate the deal score. Basically the same as iBug's question, which was deleted. I figured out this scoring system while trying to answer ...
TFeld's user avatar
  • 19.9k
11 votes
13 answers
830 views

Scoring Briscola

Introduction Briscola is one of Italy's most popular card games. It is a trick-taking card game, like Bridge. Briscola is well known for its bizarre point system. In this challenge, given two cards, ...
Amphibological's user avatar
8 votes
8 answers
1k views

Was it a Superb Shuffle™️

According to this question a Superb Shuffle™️ is defined as a full deck of cards (including jokers) which follows this set of rules: No two cards (except Jokers) of the same suit are adjacent. No ...
AJFaraday's user avatar
  • 11.8k
15 votes
13 answers
4k views

Execute a Superb Shuffle™

For the purposes of this question, a deck of cards is formatted in this way: ...
AJFaraday's user avatar
  • 11.8k
51 votes
12 answers
9k views

Professor at MIT can read minds!

The task is taken from an MIT lecture by Prof. Devadas called You can read minds. A detailed explanation of the trick can be found in the linked video, or in this document. I'll try to explain it in ...
Stewie Griffin's user avatar
12 votes
8 answers
1k views

Blackjack Bust Calculator

Blackjack, also known as twenty-one, is a comparing card game between yourself and a dealer, where each player in turn competes against the dealer, but players do not play against each other. Play ...
DevelopingDeveloper's user avatar
17 votes
13 answers
2k views

Want to see a Magic Card Trick?

The first magic card trick I ever learned as a child was the following: Have 1 deck of cards where the pattern on the back is not vertically symmetric. Organize all cards to be facing one direction. ...
Magic Octopus Urn's user avatar
5 votes
3 answers
663 views

Wanna See a Card Trick? (Part I)

Amazingly, this is the easier of the three card tricks I know off the top of my head... The aim of this is to have your compiler perform a specific card trick. There's no slight of hand, and the ...
Eliseo D'Annunzio's user avatar
4 votes
0 answers
70 views

Cribbage Scoring [duplicate]

My brothers and I like to play Cribbage. Now, the scoring rules for Cribbage are somewhat complicated, and I often worry that I'm not counting my score correctly. Therefore, your job is to write a ...
Bolce Bussiere's user avatar
19 votes
14 answers
2k views

Is it a shuffle?

Yesterday I asked this question about riffle shuffles. It seems that yesterdays question was a bit too hard so this question is a related but much easier task. Today you are asked to determine if a ...
Wheat Wizard's user avatar
  • 99.6k
18 votes
2 answers
575 views

How many shuffles

A riffle shuffle is a type of shuffle where the deck is split into two partitions and the partitions are then spliced back together to create a new shuffled deck. The cards are spliced together in ...
Wheat Wizard's user avatar
  • 99.6k
20 votes
9 answers
835 views

Hand patterns in a card game

A deck of cards is the Cartesian product of S suits and R ranks. Many, though not all, card games use ...
ngn's user avatar
  • 15.3k
13 votes
10 answers
830 views

Deal an ASCII Deck

There's never really been a definitive ASCII-cards challenge AFAIK. So, using the following deck of ASCII cards: ...
Magic Octopus Urn's user avatar
9 votes
4 answers
526 views

Badugi, Who Wins?

Inspired by this challenge and related to this one. Background Badugi [bæduːɡiː] is a low-ball draw-poker variant. The Pokerstars World Cup Of Online Poker $1K event starts within 3 hours and I'll ...
Jonathan Allan's user avatar
8 votes
4 answers
1k views

1326 starting hold'em combos

The goal is to get all combinations of hold'em starting hands (every two card combination) in the shortest amount of code. A hold'em hand is two distinct cards dealt from a standard deck of 52 cards, ...
lessharm's user avatar
8 votes
6 answers
1k views

Dungeon of botdom

– of crisis and martyrdom (that's the subtitle because subtitles are cool) In this king-of-the-hill challenge in python (yup; you need go no farther to know you may not submit in java), you need to ...
Destructible Lemon's user avatar