BASIC
From Maze
(Difference between revisions)
(→BASIC Code in Human Memory) | (→Sidebar: Remembering 10 PRINT) | ||
| Line 184: | Line 184: | ||
== Sidebar: Remembering 10 PRINT == | == Sidebar: Remembering 10 PRINT == | ||
| − | When I first wrote about a similarly-functioning program, I presented this version: <code>10 PRINT CHR$(109+RND(1)*2); : GOTO 10</code>. That's the program I discussed very briefly in my article "Obfuscated Code" in ''Software Studies: A Lexicon,'' and that's the same text I presented to Mark Marino's online Critical Code Studies Workshop, where it sparked the discussion that led to this book. It does the same thing as our title program, for two reasons: First, 205 and 206 are mapped to the same characters as 109 and 110; second, adding a random number between 0 and 2 does the same thing, due to rounding, as adding .5 and adding a random number between 0 and 1. The version we are using in the title of this book is based on (although not identical to) two early print sources for the program, the three-line program in the ''Commodore 64 Users Guide'' and the one-line version in ''RUN Magazine.'' There are no print sources from the 1980s that we have found that use "RND(1)*2" or that use 109 and 110 rather than 205 and 206. | + | When I first wrote about a similarly-functioning program, I presented this version: <code>10 PRINT CHR$(109+RND(1)*2); : GOTO 10</code>. That's the program I discussed very briefly in my article "Obfuscated Code" in ''Software Studies: A Lexicon,'' and that's the same text I presented to Mark Marino's online Critical Code Studies Workshop, where it sparked the discussion that led to this book. It does the same thing as our title program, for two reasons: First, 205 and 206 are mapped to the same characters as 109 and 110; second, adding a random number between 0 and 2 does the same thing, due to rounding, as adding .5 and then also adding a random number between 0 and 1. The version we are using in the title of this book is based on (although not identical to) two early print sources for the program, the three-line program in the ''Commodore 64 Users Guide'' and the one-line version in ''RUN Magazine.'' There are no print sources from the 1980s that we have found that use "RND(1)*2" or that use 109 and 110 rather than 205 and 206. |
| − | Why did I initially bring up this "corrupt" version of the program? Simply because I reconstructed 10 PRINT from memory and looked at a chart of "PETSCII" characters values when I was doing so. Since 109 and 110 are lower numerically and closer to the values for the characters A-Z, I found them first in the manual and used those values. | + | Why did I initially bring up this "corrupt" version of the program? Simply because I reconstructed 10 PRINT from memory and looked at a chart of PETSCII characters values when I was doing so. Since 109 and 110 are lower numerically and closer to the values for the characters A-Z, I found them first in the manual and used those values. |
Our discussion of this program is based on the print versions of it that I found early in the process of working on this book -- but the version of the program that started our discussion came from my memory. | Our discussion of this program is based on the print versions of it that I found early in the process of working on this book -- but the version of the program that started our discussion came from my memory. | ||
