Re: Programming Challenge


[Prev][Next][Index][Thread]

Re: Programming Challenge



For that bit of code, yes, you could do that.  However, the original
intent was to randomly arrange the numbers from 1 to 60.  Both methods
here would have duplication of numbers.  One of the previous methods
suggested is best.  (Notice they were all variations on a theme.  I still
think mine is the more elegant, but they are all effective.)

>Couldn't we just write
>
>60 -> dim(L1)
>For(X,1,60)
>int(rand*60)+1 -> L1(X)
>end
>
>?
>
>>60 -> dim(L1
>>Fill(0,L1
>>For(X,1,60)
>>Lbl 1
>>int(rand*60)+1->Y
>>if L1(X) = 0
>>then
>>Y->L1(X)
>>else
>>Goto 1
>>end
>>end
>
>
> -= Gabriel Chênevert =-
>  gabrielc@yeshua.co.uk