The Architect

This brief program produces an interesting, constantly changing display and demonstrates an interesting point about ZX/TS graphics.

It looks like an over-the-shoulder view of the architect’s sketch pad while he plays with ideas for the shell of a high-rise building. Some of his plans are bizarre; some have a neat 3D effect. Some I liked well enough to record them on the printer. Just as the right-hand wall completed, I hit BREAK and COPY to retain his sketch. When I hit CONT, he went right on redesigning.

This program demonstrates that the PRINT and PLOT commands on your ZX/TS ignore negative values. The command PRINT AT -12,-12;”X” will not produce an “X” floating somewhere to the left of your screen, but will have the same effect as PRINT AT 12,12…

Note line 80. This FOR starts the print of the plot pixel and the random graphics at the horizontal coordinate 54 and continues to -54. When the value of the loop control variable J becomes -1, it is read as a +1 and the direction of the printing changes to right to left.

   5 RAND
10 PRINT "QUIET, PLEASE. THE ARCHITECT IS DESIGNING A HIGH-RISE."
20 LET A$=CHR$ (INT (RND*4)+2)
30 LET B$=CHR$ (INT (RND*4)+2)
40 LET C$=CHR$ (INT (RND*4)+2)
50 LET D$=CHR$ (INT (RND*4)+2)
60 LET E$=A$+B$+C$+D$
70 LET A=INT (RND*3)+5
80 FOR J=54 TO -54 STEP -A
90 FOR K=1 TO 34
100 PLOT J,K
110 PRINT E$
120 NEXT K
130 NEXT J
140 PRINT AT 3,0;"▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄"
150 PRINT AT 4,0;"█"
160 FOR J=4 TO 21
170 PRINT AT J,31;"▐"
180 NEXT J
190 GOTO 20
SYNTACTIC SUM: 28684, 8K ROM

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.