When I use the line:
num = Random2(-12,12) I expected num to have a different number when running the program multiple times. Instead, it produces 10 every time I run the program.
Here is the code in full:
// set window properties
SetWindowTitle("Random Number")
SetWindowSize(1024,768,0)
// set display properties
SetDisplayAspect(1024/768.0)
UseNewDefaultFonts(1)
num = Random2(-12,12)
if num = 0
message$ = "zero"
else
if num > 0
message$ = "positive"
else
message$ = "negative"
endif
endif
do
PrintC("The number is ")
PrintC(num)
PrintC(" and is ")
Print(message$)
Sync()
loop
If I change the numbers in the Random2() call, to say Random2(-20,20) it gives me a different result, but repeats that result everytime the program is run.
Putting in the line SetRandomSeed2(GetUnixTime()) corrects the problem.
The above code works fine in AGK2 Classic.
This appears to be a bug. Following the suggested steps, I post this for others to confirm or not.