M
Mark Healey
Here's the code:
signed char xMove, yMove, subx, suby;
[a bunch of stuff snipped]
xMove=(3*((float)rand()/(float)RAND_MAX))-1;
yMove=(3*((float)rand()/(float)RAND_MAX))-1;
I run srand() in main. When I run it without the -1 I get 0-2 as expected
but when I run it with them I get 0 and 1.
Why?
signed char xMove, yMove, subx, suby;
[a bunch of stuff snipped]
xMove=(3*((float)rand()/(float)RAND_MAX))-1;
yMove=(3*((float)rand()/(float)RAND_MAX))-1;
I run srand() in main. When I run it without the -1 I get 0-2 as expected
but when I run it with them I get 0 and 1.
Why?