Pig the dice game/Player: Difference between revisions
m
→{{header|Sidef}}: modified the code to work with the latest version of Sidef
m (→{{header|Sidef}}: modified the code to work with the latest version of Sidef) |
|||
Line 2,578:
=={{header|Sidef}}==
{{trans|Perl 6}}
<lang ruby>var (games=100) = @ARGV
define DIE = 1..6;
Line 2,589:
loop {
self.rolls++;
given (var roll = DIE.rand) {
self.ante = 0;
break;
}
self.ante += roll;
}
self.score += ante;
}
Line 2,633 ⟶ 2,630:
p.turn;
p.score >= GOAL && break;
}
wins[player % players.len]++;
players.map{.score}.join("\t").say;
|