Re: Help with C++ Code to Flowcode Conversion
Posted: Sun Oct 17, 2021 4:16 pm
Random in Flowcode returns a value between 0 and 0xFFFF
To 'clamp' it to -2..2
should do what you need
% operator is mod (modulus) - so random() % 5 will return a number in the range 0..4 then -2 gives -2 .. 2
Martin
To 'clamp' it to -2..2
Code: Select all
.hSkew = (random() % 5) - 2
% operator is mod (modulus) - so random() % 5 will return a number in the range 0..4 then -2 gives -2 .. 2
Martin