#card #card-game #solitaire #patience #game

freecell

Game objects and rules for the solitaire card game FreeCell

1 unstable release

0.1.0 Nov 26, 2019

#1694 in Game dev

MIT/Apache

45KB
761 lines

FreeCell

tests unsafe forbidden License: MIT OR Apache-2.0

Game objects and rules for the solitaire card game FreeCell, written in Rust.

THIS PROJECT IS A WORK IN PROGRESS

FreeCell Rules

Source: Wikipedia

  • Construction and layout
    • One standard 52-card deck is used.
    • There are four open freecells and four open foundations.
    • Cards are dealt face-up into eight cascades, four of which comprise seven cards each and four of which comprise six cards each.
  • Building during play
    • The top card of each cascade begins a tableau.
    • Tableaux must be built down by alternating colors.
    • Foundations are built up by suit.
  • Moves
    • Any freecell card or top card of any cascade may be moved to build on a tableau, or moved to an empty cell, an empty cascade, or its foundation.
    • Complete or partial tableaus may be moved to build on existing tableaus, or moved to empty cascades, by recursively placing and removing cards through intermediate locations.
  • The game is won after all cards are moved to their foundation piles.

Not all deals are solvable, but the probability of an unsolvable deal is very low. It is estimated that 99.999% of possible deals are solvable.

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.

Dependencies

~74KB