Draws the United States flag in color using block graphics characters. The blue field fills the top left, the red stripes are built from full and half-block characters so that each character row holds parts of two stripes, and two alternating rows of asterisks are overprinted on the field with OVER 1 to make the stars. The program then holds the picture on screen.
This program is on side B of the Long Island Sinclair Timex (LIST) user group library tape #3.5.
Program Analysis
Program Structure
Lines 10-30 fill the blue field with INK 1 full blocks. Lines 40-90 draw the top stripe and clear alternate rows. Lines 100-210 print the remaining red stripes as rows of top-half, bottom-half and full blocks. Lines 220-250 overprint the star rows, and line 270 loops forever.
Notable Techniques
- The star rows alternate between six and five asterisks over nine rows, which gives the 50 stars of the flag: 5 x 6 + 4 x 5.
Source Code
5 REM old glory
6 BORDER 5
10 FOR I=0 TO 11
15 FOR J=2 TO 11
20 PRINT INK 1;AT J,I;"::"
25 NEXT J
30 NEXT I
40 FOR I=12 TO 31
50 PRINT INK 2;AT 2,I;"::"
60 FOR J=3 TO 16 STEP 2
70 PRINT AT J,I;" "
80 NEXT J
90 NEXT I
100 PRINT INK 2;AT 3,12;"''''''''''''''''''''''''''''''''''''''''"
110 PRINT INK 2;AT 4,12;"........................................"
120 PRINT INK 2;AT 5,12;"::::::::::::::::::::::::::::::::::::::::"
130 PRINT INK 2;AT 7,12;"........................................"
140 PRINT INK 2;AT 8,12;"::::::::::::::::::::::::::::::::::::::::"
150 PRINT INK 2;AT 10,12;"........................................"
155 PRINT INK 2;AT 11,12;"::::::::::::::::::::::::::::::::::::::::"
170 PRINT INK 2;AT 13,0;"::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::"
180 PRINT INK 2;AT 14,0;"''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''"
185 PRINT INK 2;AT 15,0;"................................................................"
190 PRINT INK 2;AT 16,0;"::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::"
200 PRINT INK 2;AT 18,0;"................................................................"
210 PRINT INK 2;AT 19,0;"::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::"
220 LET I$="* * * * * * "
230 LET B$=" * * * * * "
235 PAUSE 10
240 OVER 1: PRINT INK 1;AT 2,0;I$;AT 3,0;B$;AT 4,0;I$;AT 5,0;B$;
250 OVER 1: PRINT INK 1;AT 6,0;I$;AT 7,0;B$;AT 8,0;I$;AT 9,0;B$;AT 10,0;I$
270 GO TO 270Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.