FreeCell

I implemented my favorite card game, FreeCell, for Android. It was the natural thing to do since I feel that most existing implementations are incorrect or annoying. Most of the existing apps are packed with ads, implement the rules incorrectly, and perform annoying auto-moves that disrupt concentration. The features of my implementation are listed below:

  • Proper rules: cards are not allowed to be moved back off the foundations under any circumstance
  • Cryptographically-secure shuffle without any proprietary game numbering schemes
  • Minimalistic, procedurally rendered cards that look crisp at all resolutions
  • Smart scaling of long tableau piles: if more than half of the top card is cut off, then the vertical spacing is adjusted
  • No automatic movements; no "no more moves" messages; no win effects
  • Limited undo: the user can (re)save one checkpoint and jump back to it at any point, or jump back to the beginning of the game
  • Game state is automatically saved when the application is sent to the background
  • Multi-deck support

Details

The standard 52-card deck is shuffled using an instantiation of SecureRandom. Note that no proprietary seed value is used to index the deals due to the fact that such an identifier would be neither portable nor meaningful to other users. Instead of iterating through an arbitrary seed space, simply generate a uniformly random deal each time instead. Encountering a duplicate deal would require observing approximately sqrt(52!) uniformly random deals. Even if you were able to play 216 = 65536 games per second, it would take approximately 271 years to encounter a duplicate shuffle. Additionally, I have implemented a deal encoding that allows importing/exporting an arbitrary deal. The identifier is universal and independent of the random number generator.

FreeCell

FreeCell

FreeCell

FreeCell