From: h4y4shi 13bladex Date: 2012-02-04T09:43:14+09:00 Subject: 4 random numbers take highest 3 and add them together. I want to get 4 random numbers. The numbers will be between 1-6. I want to disregard the smallest number and add the three biggest numbers together. So far I wrote some ruby that I thought would do this but I keep getting an error. statsrand = 0 while statsrand == 0 stats1a = (rand(6) + 1) stats1b = (rand(6) + 1) stats1c = (rand(6) + 1) stats1d = (rand(6) + 1) gstats1a = 0 gstats1b = 0 gstats1c = 0 gstats1d = 0 when (stats1a>stats1b) | (stats1a>stats1c) | (stats1a>stats1d) gstats1a = stats1a when (stats1b>stats1a) | (stats1b>stats1c) | (stats1b>stats1d) gstats1b = stats1b when (stats1c>stats1b) | (stats1c>stats1a) | (stats1c>stats1d) gstats1c = stats1c when (stats1d>stats1b) | (stats1d>stats1c) | (stats1d>stats1a) gstats1d = stats1d mstr = gstats1a + gstats1b + gstats1c + gstats1d I cant find where the error is... -- Posted via http://www.ruby-forum.com/.