Random walk program
Again num 4 is alawys 0 so that would mean num3 is always either -1 or 1. If you wish to do it you will either have to add that to the other num3
1 2
|
num3 += num4 - 1;
num3 += num4 + 1;
|
or modify num4 before assigning to num3.
though as I mentioned it would be best to just modify num3 directly and not use num4.
Topic archived. No new replies allowed.