Atari Mystery Commands
I frequently see statements in programs that just don't seem to make sense. For example, in "Diamond Drop," Atari version (COMPUTE!, September 1983), lines 5430 and 5750 have the statement Q = 1∧1. As I understand it, that means 1 raised to the first power, which is 1 times 1, which is just 1. So why write it this other way? Also, if you remove it, and just change the statements to Q = 1, then the diamonds drop faster, but why?
Also, in some programs there will be a loop FOR X = 0 TO 1 STEP 0. What is the meaning of this? If you start at zero with a STEP of 0, what happens?
Roy R. Valantine
The Atari takes a significant amount of time to calculate powers and roots. Matt Ciwer, the author of "Diamond Drop," took advantage of this and used Q = 1∧1 in place of a delay loop to slow down the game. This statement takes up less memory than an empty FOR-NEXT loop. To answer your second question, remember that the STEP value is added to the original value in a FOR-NEXT loop at every NEXT. With a STEP of zero, X will never become equal to one. This is just a faster way of writing an endless loop. Instead of:
10 PRINT I : I = SQR(I) 20 GOTO 10
you can use:
5 FOR X = 0 TO 1 STEP 0 10 PRINT I : I = SQR(I) 20 NEXT X
Execution will continue until you press BREAK or SYSTEM RESET.