Random walk program

Pages: 12
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.
1
2
--num4;
num3 = num4;
though as I mentioned it would be best to just modify num3 directly and not use num4.
1
2
++num3;
--num3;
Topic archived. No new replies allowed.
Pages: 12