Please Forward: Ruby Quiz Submission

From: "Linklater, Lloyd \(IT\)" <>
Date: June 6, 2007 1:11:09 PM CDT
To: <>
Subject: Please Forward: Ruby Quiz Submission

Ok, I know that this has got to be annoying, but it is my first time and I just had to ask. Is this a better way to do it?

ar =
stats =
bestStats =
10_000.times do |k|
  6.times do |j|
    ar = [rand(6), rand(6), rand(6), rand(6)].sort
    stats[j] = ar[1] + ar[2] + ar[3] + 3
  bestStats[k] = stats.sort.reverse
p bestStats.sort.reverse[0]

OK. Even if I think of a super improvement, I will keep it to myself. Thanks again!

Lloyd Linklater


Begin forwarded message: