# 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).

20 questions
Filter by
Sorted by
Tagged with
3k views

### Faro shuffle an array

A Faro shuffle is a technique frequently used by magicians to "shuffle" a deck. To perform a Faro shuffle you first cut the deck into 2 equal halves then you interleave the two halves. For ...
• 59.2k
760 views

### Cycle lengths for Perfect shuffles of decks of any size

Challenge In the shortest amount of code: Compute the length of the permutation cycle of a perfect shuffle on a deck of cards of any size n (where n ≥ 2 and n is even). Output a table of all cycle ...
• 1,819
9k views

### Magic the Gathering: Friends or Foes?

In the card game Magic: the Gathering there are five different colours, which represent loose affiliations of cards, White (W), Blue (...
• 197k
390 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). ...
• 175
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 ...
• 46.3k
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 ...
• 192k
2k views

### Magic: the Gathering Combat Golf

Magic: the Gathering is a trading card game where, among other things, players play cards representing creatures, which can then attack the other player, or defend against the other player's attacks ...
• 42k
2k views

### Golf a golf-scorer

As a kid, I used to play the card game "golf" a lot. Your challenge, should you choose to accept it, is to calculate the score of a golf hand. Since there are over 9000 variations on this ...
• 59.2k
2k views

### Score a hand of Hearts

Hearts is a trick-taking card game for 4 players. Each trick is taken by the player who played the highest card of the leading suit. At the end of each hand, the players incur a penalty score ...
834 views

### Can you cast the spell?

In Magic: the Gathering, mages (known as "planeswalkers") battle each other by casting spells. Spells cost mana. Five colors of mana exist: White, Blue, Black, Red, and Green, represented as {W}, {U}, ...
• 6,376
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 ...
• 98.5k
573 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 ...
• 98.5k
4k views

### Execute a Superb Shuffle™

For the purposes of this question, a deck of cards is formatted in this way: ...
• 11.8k
984 views

### Simulate a 'battle' in the playing card game 'Oorlog'

Let's build a simulation for an aspect in the card game, which I personally know by the Dutch name 'Oorlog' (translates to 'War'). How does 'Oorlog' work? Two decks of cards (each including two Jokers)...
• 126k
719 views

### Solve a game of Accordion

Accordion is a solitaire card game I recently came across where nearly every layout is solvable, but incredibly hard. You can play it here. Rules 52 face cards are placed face-up in a random order. ...
• 14.5k
429 views

### Bridge Hand Scoring

One of the things that makes contract bridge very interesting is its highly complicated "artificial" meta game. This system of scoring hands is a small part of it. Bridge is a trick-taking ...
• 11.2k
781 views

### Score counter for Skat

You task is to write a small program, that counts the points of a Skat hand. A Skat deck has cards 7 to 10, Jack, Queen, King and Ace (called Unter, Ober, König and Daus). We use the German suits, ...
• 10.1k
544 views

### Name the Brag Hand

Background Brag is a card game similar in concept to, but simpler than, poker. A hand in brag consists of three cards and is ranked as follows from highest to lowest: Three of a kind - all three ...
• 212
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, ...
• 83