Anonymous user
Talk:Deal cards for FreeCell: Difference between revisions
m
→support for games -1 and -2: made some cosmetic changes.
(added a new talk section.) |
m (→support for games -1 and -2: made some cosmetic changes.) |
||
Line 61:
if game==-1 then rank= 'AQ3t587694J2K' /*a special rank for a game of -1. */
if game==-2 then rank= 'A7K6Q5J4t3928' /*" " " " " " " -2. */
say center('tableau for FreeCell game' game, 50, "─") /*show title for FreeCell game #*/
say /* [↓] @ is an array of all 52 cards.*/
Line 69:
end /*s*/ /* [↑] first card is number 0 (zero).*/
end /*r*/ /* [↑] build deck per FreeCell rules. */
$=
r=1
?=rand() // (cards + 1) /*get next rand#; card # is remainder.*/
if game<0 then $=$ minus()
else $=$ @.?; @.?= @.cards /*swap two cards: use random and last.*/
if words($)==cols then do; say $; $=
end
end /*cards*/ /*normally, 8 cards are dealt to a row.*/
|