Talk:Find the missing permutation: Difference between revisions

Can't find the missing element
(Can't find the missing element)
Line 3:
: Do you want me to add in the Tcl solution for this task? –[[User:Dkf|Donal Fellows]] 09:41, 24 December 2009 (UTC)
 
Hmm, when I test the Perl <tt>shuffle</tt> code with:
<lang perl>my @tot = (0, 0, 0, 0, 0);
for my $x (1 .. 100000) {
my @a = shuffle(1, 2, 3, 4, 5);
for (0 .. 4) {
$tot[$_] += $a[$_];
}
}
print "totals: @tot\n"</lang>
I get totals that indicate that things are OK. Not sure what's wrong then, if anything. Don't think it really matters though; the list of permutations doesn't have an ''obviously'' missing element, so a short program is indeed the best way to find the missing item. –[[User:Dkf|Donal Fellows]] 10:31, 24 December 2009 (UTC)
== Prototype Tcl Solution ==
 
Anonymous user