Re: code-block

new topic     » goto parent     » topic index » view thread      » older message » newer message

That'll work, but I'd do it this way:

function rand_not( integer x )
  integer r
  r = rand( max-1 )
  if r >= x then r += 1 end if
  return r
end function

You're guaranteed to only have one call to rand().

Matt

--- "Darth Maul, aka Matt" <uglyfish87 at HOTMAIL.COM> wrote:
> function anything_but(integer x)
>   integer i i=x
>   while i=x do i=rand(yourmaximumhere) end while
>   return i
> end function


__________________________________________________
Do You Yahoo!?
Yahoo! Mail - Free email you can access from anywhere!
http://mail.yahoo.com/

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu