Difference between revisions of "Deal cards for FreeCell"
(Creation of page) |
(→Program) |
||
Line 67: | Line 67: | ||
=== Program === | === Program === | ||
− | [[File:DealCardsFreeCell.png|thumb|link=http://wiki.formulae.org/mediawiki/images/ | + | [[File:DealCardsFreeCell.png|thumb|link=http://wiki.formulae.org/mediawiki/images/f/f9/DealCardsFreeCell.png|The same program when the flowchart package visualization is selected. Click/tap to enlarge]] |
[[File:DealCardsFreeCellCode.png|border]] | [[File:DealCardsFreeCellCode.png|border]] |
Revision as of 11:09, 29 March 2019
This page is the answer to the task Creating Deal cards for FreeCell in the Rosetta Code.
Description (from Rosetta Code)
Free Cell is the solitaire card game that Paul Alfille introduced to the PLATO system in 1978. Jim Horne, at Microsoft, changed the name to FreeCell and reimplemented the game for DOS, then Windows.
This version introduced 32000 numbered deals. (The FreeCell FAQ tells this history.) As the game became popular, Jim Horne disclosed the algorithm, and other implementations of FreeCell began to reproduce the Microsoft deals. The algorithm uses this linear congruential generator from Microsoft C:
The algorithm follows:
Deals can also be checked against FreeCell solutions to 1000000 games. (Summon a video solution, and it displays the initial deal.) Write a program to take a deal number and deal cards in the same order as this algorithm. The program may display the cards with ASCII, with Unicode, by drawing graphics, or any other way. |