RandExcept (rifddle)

BlitzMax Forums/BlitzMax Beginners Area/RandExcept (rifddle)

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Can you make a function that returns a random integer (int) number in certain range but except one? In example, RandExcept(3, 9, 5) can return 3, 4, 6, 7, 8, 9 with equal chances, but never 5.

Main limitation is that you only allowed to enter code in one sting after "Return", so it'll be one formula.

Just interesting.

Function RandExcept(v1, v2, ev)
 Return ' Your code must be only here in this line after Return
End Function


P. S. This riddle obviously HAVE a solution :)