? : syntax

Blitz3D Forums/Blitz3D Beginners Area/? : syntax

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.

As far as I'm aware it doesn't exist in blitz however...
x = ((Rand(0,1) * 2) - 1) * 3

explained...
(0 or 1) * 2 = (0 or 2) - 1 = (-1 or 1) * 3 = (-3 or 3)

That said... I'm not sure if it's going to be faster to just do
if rand(0,1) then x=3 else x=-3