10 REM ========================================
20 REM BASIC Graphics Demo - ASCII Art
30 REM This program creates patterns and art 
40 REM using BASIC programming techniques
50 REM ========================================
60 REM 
70 PRINT "BASIC ASCII Art Generator"
80 PRINT "========================="
90 PRINT
100 REM Menu system
110 PRINT "Choose a pattern to draw:"
120 PRINT "1. Triangle"
130 PRINT "2. Square"
140 PRINT "3. Diamond"
150 PRINT "4. Christmas Tree"
160 PRINT "5. Spiral"
170 PRINT "6. Exit"
180 INPUT "Enter your choice (1-6): "; CHOICE
190 REM
200 ON CHOICE GOTO 300, 400, 500, 600, 700, 999
210 PRINT "Invalid choice! Please try again."
220 GOTO 110
230 REM
300 REM Draw Triangle
310 PRINT "Drawing a Triangle:"
320 INPUT "Enter size (3-10): "; SIZE
330 FOR ROW = 1 TO SIZE
340   FOR SPACE = 1 TO SIZE - ROW
350     PRINT " ";
360   NEXT SPACE
370   FOR STAR = 1 TO 2 * ROW - 1
380     PRINT "*";
390   NEXT STAR
400   PRINT
410 NEXT ROW
420 GOTO 800
430 REM
440 REM Draw Square
450 PRINT "Drawing a Square:"
460 INPUT "Enter size (3-15): "; SIZE
470 FOR ROW = 1 TO SIZE
480   FOR COL = 1 TO SIZE
490     IF ROW = 1 OR ROW = SIZE OR COL = 1 OR COL = SIZE THEN
500       PRINT "*";
510     ELSE
520       PRINT " ";
530     END IF
540   NEXT COL
550   PRINT
560 NEXT ROW
570 GOTO 800
580 REM
590 REM Draw Diamond
600 PRINT "Drawing a Diamond:"
610 INPUT "Enter size (3-8): "; SIZE
620 REM Top half
630 FOR ROW = 1 TO SIZE
640   FOR SPACE = 1 TO SIZE - ROW
650     PRINT " ";
660   NEXT SPACE
670   FOR STAR = 1 TO 2 * ROW - 1
680     PRINT "*";
690   NEXT STAR
700   PRINT
710 NEXT ROW
720 REM Bottom half
730 FOR ROW = SIZE - 1 TO 1 STEP -1
740   FOR SPACE = 1 TO SIZE - ROW
750     PRINT " ";
760   NEXT SPACE
770   FOR STAR = 1 TO 2 * ROW - 1
780     PRINT "*";
790   NEXT STAR
800   PRINT
810 NEXT ROW
820 GOTO 800
830 REM
840 REM Draw Christmas Tree
850 PRINT "Drawing a Christmas Tree:"
860 SIZE = 5
870 REM Tree top
880 FOR LEVEL = 1 TO 3
890   FOR ROW = 1 TO SIZE - LEVEL + 2
900     FOR SPACE = 1 TO SIZE - ROW + LEVEL
910       PRINT " ";
920     NEXT SPACE
930     FOR STAR = 1 TO 2 * ROW - 1
940       PRINT "*";
950     NEXT STAR
960     PRINT
970   NEXT ROW
980 NEXT LEVEL
990 REM Tree trunk
1000 FOR TRUNK = 1 TO 2
1010   FOR SPACE = 1 TO SIZE
1020     PRINT " ";
1030   NEXT SPACE
1040   PRINT "***"
1050 NEXT TRUNK
1060 GOTO 800
1070 REM
1080 REM Draw Spiral
1090 PRINT "Drawing a Number Spiral:"
1100 SIZE = 5
1110 DIM GRID(SIZE, SIZE)
1120 REM Initialize grid
1130 FOR I = 1 TO SIZE
1140   FOR J = 1 TO SIZE
1150     GRID(I, J) = 0
1160   NEXT J
1170 NEXT I
1180 REM Fill spiral
1190 NUM = 1
1200 TOP = 1: BOTTOM = SIZE: LEFT = 1: RIGHT = SIZE
1210 WHILE TOP <= BOTTOM AND LEFT <= RIGHT
1220   REM Fill top row
1230   FOR COL = LEFT TO RIGHT
1240     GRID(TOP, COL) = NUM
1250     NUM = NUM + 1
1260   NEXT COL
1270   TOP = TOP + 1
1280   REM Fill right column
1290   FOR ROW = TOP TO BOTTOM
1300     GRID(ROW, RIGHT) = NUM
1310     NUM = NUM + 1
1320   NEXT ROW
1330   RIGHT = RIGHT - 1
1340   REM Fill bottom row (if exists)
1350   IF TOP <= BOTTOM THEN
1360     FOR COL = RIGHT TO LEFT STEP -1
1370       GRID(BOTTOM, COL) = NUM
1380       NUM = NUM + 1
1390     NEXT COL
1400     BOTTOM = BOTTOM - 1
1410   END IF
1420   REM Fill left column (if exists)
1430   IF LEFT <= RIGHT THEN
1440     FOR ROW = BOTTOM TO TOP STEP -1
1450       GRID(ROW, LEFT) = NUM
1460       NUM = NUM + 1
1470     NEXT ROW
1480     LEFT = LEFT + 1
1490   END IF
1500 WEND
1510 REM Display grid
1520 FOR I = 1 TO SIZE
1530   FOR J = 1 TO SIZE
1540     PRINT USING "##"; GRID(I, J);
1550     PRINT " ";
1560   NEXT J
1570   PRINT
1580 NEXT I
1590 GOTO 800
1600 REM
1700 REM Continue or exit
1710 PRINT
1720 PRINT "Would you like to draw another pattern?"
1730 INPUT "Enter Y for Yes, N for No: "; CONTINUE$
1740 IF CONTINUE$ = "Y" OR CONTINUE$ = "y" THEN GOTO 110
1750 REM
1760 PRINT "Thanks for using the BASIC ASCII Art Generator!"
1770 PRINT "Keep creating amazing patterns!"
1780 END