Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.7.2
-
None
-
None
-
Windows 7 64 bit
Description
I have found an issue with array incrementation, when using randomly generated number as array index.
The idea was to randomly increment one of the indexes.
For array of size = 3 and 10 incrementations I can see array was modified like this [example from system.out]:
[0, 0, 1]
[0, 0, 1]
[2, 0, 1] should be [1,0,1]
[2, 3, 1] should be [1,1,1]
[3, 3, 1] should be [2,1,1]
[3, 2, 1] now I'm puzzled as the digit is decremented!
[3, 2, 1] what was incremented? no one knows! ;]
[3, 2, 2]
[3, 2, 3]
[3, 3, 3]
See the code attached.
Additional info:
When the randomiser invocation is moved to assign value to a variable, and then variable is used as array index it works fine.