Deal cards for FreeCell: Difference between revisions

Content added Content deleted
(→‎{{header|PureBasic}}: Changed parameters of RNG())
(GP)
Line 332: Line 332:
4S TS 2H 5D JC 6C JH QH
4S TS 2H 5D JC 6C JH QH
JD KS KC 4H</pre>
JD KS KC 4H</pre>

=={{header|PARI/GP}}==
<lang parigp>card(n)=concat(["A","2","3","4","5","6","7","8","9","T","J","Q","K"][n\4+1],["C","D","H","S"][n%4+1]);
nextrand()={
(state=(214013*state+2531011)%2^31)>>16
};
deal(seed)={
my(deck=vector(52,n,n-1),t);
local(state=seed);
forstep(last=52,1,-1,
t=nextrand()%last+1;
print1(card(deck[t])if(last%8==5,"\n"," "));
deck[t]=deck[last]
)
};</lang>


=={{header|Perl}}==
=={{header|Perl}}==