128 84 r---t-~t---t-~t---t----t 32 t--+---11--+ t--+--+ 16 8 4 2 1 13 I 27 74 10 13 74 49 10 13 13 74 10 10 Figure 7-7. Pin patterns of incorrect program You may also wonder why the program prints not only the different pin patterns but also the character "]" a number of times. The reason lies in the number of columns you reserved with the graphics com- mand. After the MPS 1000 receives all the numbers reserved by a graphics command-50 in this case-it leaves the graphics mode and resumes interpreting numbers as printable characters or print com- mands.
Since the incorrect program has sent many extra numbers, mainly 10s and l 3s, the 50 columns reserved are filled before the loop in line 40 has been executed 50 times. Therefore, during the last passes of the loop the MPS 1000 interprets CHR$(7 4) as the ASCII code for "]" and prints that character each of the last 3 5 passes of the loop. If you want to make the program work correctly, put the line-spacing command in line 10, delete line 30, and add two semicolons: one at the end ofline 20 and one between CHR$(74) and the colon in line 40. We have explained this incorrect program in detail so that you will remember two important tips about using the graphics command:
• Use semicolons to prevent the MPS 1000 from printing carriage return and line feed codes as pin patterns. • Do not put any other commands between the graphics command and its data. 95