Free Republic
Browse · Search
News/Activism
Topics · Post Article

To: Orion Blastar
At first I thought the program produced random letters, after reviewing it and the gosub loops I can see that it does not do this. It instead generates random numbers. My mistake, as I haven't used goto and gosub loops in a while. Modern BASIC has eliminated them.

The program is rigged to select random numbers, and not letters. If the right random number is selected it continues the loop to the next part. Instead of starting over when a wrong number is selected, it just selects another random number. The letters are hardcoded into print statements instead of being randomly selected. This is a cheat method. The program is rigged to complete the loop with programmer selected letters instead of randomly selected ones. This method is thus either flawed, mistaken, in error.

If done the right way, and selecting random letters. It will take a very long time to get close to the complete text of Hamlet, which I thought it did at first without completly looking over the whole program. Instead it just picks out "TOBEORNOTTOBE" if the right random number is selected, instead of using CHR$(X + 64) and then starting the loop all over if the string does not equal "TOBEORNOTTOBE" when the loop is finished.

Just trying to keep it honest.
460 posted on 01/10/2004 10:24:34 AM PST by Orion Blastar
[ Post Reply | Private Reply | To 459 | View Replies ]


To: Orion Blastar
The program is rigged to select random numbers, and not letters.

You got it!! So in effect the program merely waits a "random" amount of time before it prints the next letter of a predetermined text. BTW the program as it was displayed in the Skeptic magazine would even fail to run due to syntax errors.

461 posted on 01/10/2004 10:21:25 PM PST by AndrewC (I am a Bertrand Russell agnostic, even an atheist.</sarcasm>)
[ Post Reply | Private Reply | To 460 | View Replies ]

Free Republic
Browse · Search
News/Activism
Topics · Post Article


FreeRepublic, LLC, PO BOX 9771, FRESNO, CA 93794
FreeRepublic.com is powered by software copyright 2000-2008 John Robinson