Randomness

From Maze

(Difference between revisions)
Jump to: navigation, search
(→The C64 and the RND Function)
(→The C64 and the RND Function)
Line 107:Line 107:
[INCLUDE MORE ABOUT LEHMER AND A EASY-TO-FOLLOW SUMMARY OF HOW LCG WORKS. IN ADDITION TO REPEATABILITY, ARE THERE OTHER IMPORTANT PROPERTIES WORTH GOING INTO?]
[INCLUDE MORE ABOUT LEHMER AND A EASY-TO-FOLLOW SUMMARY OF HOW LCG WORKS. IN ADDITION TO REPEATABILITY, ARE THERE OTHER IMPORTANT PROPERTIES WORTH GOING INTO?]
−
Another way of using the Commodore 64's built-in random number generation begins by using RND(0)--as opposed to RND(1). This method uses the MOS6510 chip's timer as a random number generator. [HOW, EXACTLY?] [AND WHY WOULD A PROGRAM USE RND(1) OVER RND(0)? WHAT ARE ADVANTAGES AND DISADVANTAGES OF EITHER METHOD?]
+
Another way of using the Commodore 64's built-in random number generation begins by using RND(0)--as opposed to RND(1). This method uses the MOS6510 chip's timer as a random number generator. [HOW, EXACTLY?] [AND WHY WOULD A PROGRAM USE RND(1) OVER RND(0)? WHAT ARE ADVANTAGES AND DISADVANTAGES OF EITHER METHOD? ALSO, WHAT ABOUT RND(-1)?]
Finally, it is possible to generate random number on the Commodore 64 without using either RND function, relying instead upon the Sound Interface Device (SID) chip to produce random "noise." Reading the SID from register 27 (in decimal format) returns the current value of oscillator 3. If it's set to noise, the SID doubles as a random number generator. [IT'S UNCLEAR HOW THIS WORKS...MORE EXPLANATION NEEDED FOR NON-PROGRAMMING READERS]
Finally, it is possible to generate random number on the Commodore 64 without using either RND function, relying instead upon the Sound Interface Device (SID) chip to produce random "noise." Reading the SID from register 27 (in decimal format) returns the current value of oscillator 3. If it's set to noise, the SID doubles as a random number generator. [IT'S UNCLEAR HOW THIS WORKS...MORE EXPLANATION NEEDED FOR NON-PROGRAMMING READERS]

Revision as of 16:29, 16 June 2011

View this revision of Randomness.

Personal tools