Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

calculates winning trick probabilities in a simplified version of spades

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 hackspace
Octocat-spinner-32 lib
Octocat-spinner-32 test
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .rvmrc
Octocat-spinner-32 .travis.yml
Octocat-spinner-32 Gemfile
Octocat-spinner-32 Gemfile.lock
Octocat-spinner-32 Rakefile
Octocat-spinner-32 development_log.md
Octocat-spinner-32 readme.md
readme.md

Spades Probability Calculations Build Status

Purpose

Calculate the probabilities that the 2 of Clubs through Ace of Clubs, or any Spade will win the first trick in a simplified game of Spades.

The game is simplified in that card play for the first trick is completely automated:

  • if a player holds any clubs, they must play their lowest club
  • otherwise, the play may play any heart or diamond
  • if the player holds only spades, they must play one

The winner of the trick is the highest club or a spade.

Usage

The probabilities are calculated by taking a sample of N random decks containing M cards and playing through their first tricks.

# Run calculations with default (100 decks with 8 cards each)
$ rake odds

# 10000 decks containing 52 cards
$ rake odds DECKS=10_000 CARDS=52

Tests

The script is fully unit tested using minitest, run tests with rake or rake tests

Something went wrong with that request. Please try again.