Anonymous user
Deal cards for FreeCell: Difference between revisions
Updated D version
(Added PicoLisp) |
(Updated D version) |
||
Line 106:
<lang d>import std.stdio, std.conv, std.algorithm, std.range;
struct
uint seed = 1;
@property uint next() pure nothrow {
return seed >> 16;
}
}
▲ auto r = RndGenerator(seed);
// DMD 2.055 iota isn't pure nothrow. Can't remove this cast.
▲ Deck cards;
foreach (i, ref c; cards)
}
void show() {
foreach (c; row)
▲ foreach (i, c; cards) {
▲ write(" ", nums[c / 4], suits[c % 4]);
writeln();
}
}
writeln();▼
}
void main(in string[] args) {
immutable
const cards = deal(seed);▼
writeln("Hand ", seed);
}</lang>
<pre>Hand 11982
|