in reply to Trick die rolling
I leave the AddRolls sub as an exercise for the reader.use strict; my @rolls; foreach (0..3){ my $roll = 1; while ($roll == 1) { $roll = int(rand(6) + 1) ; } $rolls[$_]= $roll; } @rolls =reverse sort @rolls; pop @rolls; print @rolls; &AddRolls(\@rolls);
C-.
|
|---|