From: Ryan Davis Date: 2012-02-05T16:33:25+09:00 Subject: Re: Please help me find the error in my logical OR On Feb 4, 2012, at 18:30 , h4y4shi 13bladex wrote: > Please help me find the error in my logical OR. > When you run the program there will not be an error message. I want > the gstats numbers (a-d) to all be between 1-6 except for 1. Sometimes I > run the program and the numbers are between 1-6 except for one. Other > times I run the program and I get two numbers with the value 0. I have > looked for the error for a long time and I cannot find it. > > I think the error is in the following code. > > if (stats1a>stats1b) or (stats1a>stats1c) or (stats1a>stats1d) then > gstats1a = stats1a > end > if (stats1b>stats1a) or (stats1b>stats1c) or (stats1b>stats1d) then > gstats1b = stats1b > end > if (stats1c>stats1b) or (stats1c>stats1a) or (stats1c>stats1d) then > gstats1c = stats1c > end > if (stats1d>stats1b) or (stats1d>stats1c) or (stats1d>stats1a) then > gstats1d = stats1d > end Why aren't you using Array#sort? I'm sure it was suggested.