The following warnings occurred:
Warning [2] Undefined array key 0 - Line: 1677 - File: showthread.php PHP 8.2.31 (Linux)
File Line Function
/inc/class_error.php 157 errorHandler->error
/showthread.php 1677 errorHandler->error_callback
/showthread.php 916 buildtree




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Randomize problem? (*solved*)
#1
I've searched the forums about this issue but I haven't found anything.

I gather that RANDOMIZE uses the timer to seed the variable, doesn't it? So this program, depending on the time I take to press the key, should render different numbers. Well, the result is always 6.

Code:
Print "PRESS KEY": Pause 0 Randomize Let a = Int (Rnd * 10) Print a

If I try...

Code:
''' Dim a as uByte Dim b as uByte Print "PRESS KEY": Pause 0 b = Peek 23672 Print "FRAMES LSB IS "; b Randomize b let a = Int (Rnd * 10) Print a

The result is always 0, no matter which value is in b. This shouldn't be!

I'm using 1.2.9-s888
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)