07-19-2011, 01:13 PM
Note: CAST(Uinteger, RND) is *always* 0, because RND returns a float number form 0 to 0.99999999...
So CAST(Uinteger, RND * 3) will return an Uinteger number between 0 and 2 (which is most likely what you want). I used this 2nd form, and your program works ok.
The first ASM chunk you posted corresponds to CAST(Uinteger, RND) * 3 + 1, and won't work.
If you use the 1st one your program will looks like crashed but it is not; it's only generating the same "random" (truncated) numbers once and over again (this should happen both in 1.2.6 and 1.2.8).
Check this and tell me.
So CAST(Uinteger, RND * 3) will return an Uinteger number between 0 and 2 (which is most likely what you want). I used this 2nd form, and your program works ok.
The first ASM chunk you posted corresponds to CAST(Uinteger, RND) * 3 + 1, and won't work.
If you use the 1st one your program will looks like crashed but it is not; it's only generating the same "random" (truncated) numbers once and over again (this should happen both in 1.2.6 and 1.2.8).
Check this and tell me.
---
Boriel
Boriel