<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Wed, 01 Apr 2009 21:22:54 +0100
From   : me@... (me@...)
Subject: Bug in the BBC Master RNG?

I appear to have found a bug in the BBC Master's Random Number  
Generator. When seeded with multiple particular values, the machine  
crashes in a rather spectacular fashion. (Scared the hell out of me  
the first time it happened.)

Here's part of a BASIC program that causes it to happen, for your  
enjoyment. (The bug doesn't seem to affect the regular BBC Micro.)

10  REPEAT
20  READ A%
30  IF A%=0 THEN END
40  A%=RND(A%)
50  FOR A%=1 TO 3
60  A$=CHR$(64+RND(27))
70  IF A$=CHR$(91) THEN A$=" "
80  PRINT A$;
90  NEXT A%
100 UNTIL FALSE
110 DATA -25146,-13589,-18994,-17877,0

-- 
David Glover
http://www.davidglover.org/
<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>