10 REM - Wandering WITCH.BAS.txt

20 GOSUB 1000 : REM Clear the Screen
30 PI = 3.14159
40 DZOP "C",1 : REM Color mode [Range = 16-23]
50 XC = 128 : YC = 100 : REM Initial center of the face (lowered)
60 REM Set initial colors for the WITCH parts
70 FC = 18 : REM Initial face color (Green for the witch’s skin)
80 HC = 23 : REM Initial hat color (White for the hat)
90 EC = 19 : REM Initial face feature color (Black for eyes, nose, mouth)
100 FOR STEPS = 1 TO 1000 : REM Loop to keep WITCH wandering
110 GOSUB 4000 : REM Move the witch to a new random position
120 GOSUB 2000 : REM Draw the WITCH with changing colors
130 GOSUB 3000 : REM Pause between moves
140 GOSUB 5000 : REM Update the color scheme for the next iteration
150 GOSUB 1000 : REM Clear the screen for the next position
160 NEXT STEPS
999 GOTO 10 : REM Loop back to the beginning for continuous run

1000 REM Clear the Screen Routine
1010 DZOP "Z"
1040 RETURN

2000 REM WITCH Drawing Routine
2010 DZOP "C",FC : REM Set color for face
2020 GOSUB 2100 : REM Draw witch’s face shape
2030 DZOP "C",HC : REM Set color for hat
2040 GOSUB 2200 : REM Draw witch's hat
2050 DZOP "C",EC : REM Set color for face features (eyes, nose, mouth)
2060 GOSUB 2400 : REM Draw witch’s face features
2095 RETURN

2100 REM Draw WITCH Face Shape (Slightly pointed chin, rounded top)
2110 FOR T = 0 TO (2*PI) STEP .1
2120 X = XC + 50 * COS(T) : Y = YC + 60 * SIN(T) + 10*SIN(T) : REM Adds pointed chin
2130 IF X >= 0 AND X <= 255 AND Y >= 0 AND Y <= 255 THEN DZOP "P", X,Y : DZOP "D"
2140 NEXT T
2150 RETURN

2200 REM Draw Witch’s Hat (Curved brim and pointed top)
2210 REM Draw Hat Brim
2220 DZOP "P", XC-30,YC+40 : DZOP "L",XC+30,YC+40 : REM Adjusted brim to be just above the face
2230 DZOP "P", XC-25,YC+50 : DZOP "L",XC+25,YC+50 : REM Curve above brim within safe bounds
2240 REM Draw Pointed Top of Hat
2250 DZOP "P", XC-10,YC+50 : DZOP "L",XC,YC+70 : DZOP "L",XC+10,YC+50 : DZOP "L",XC-10,YC+50 : REM Adjusted height for safety
2290 RETURN

2400 REM Draw Witch Face Features (Eyes, crooked nose, mouth)
2410 REM Draw Eyes (Triangles)
2420 DZOP "P", XC-20,YC+10 : DZOP "L",XC-10,YC+30 : DZOP "L",XC-30,YC+30 : DZOP "L",XC-20,YC+10
2430 DZOP "P", XC+20,YC+10 : DZOP "L",XC+10,YC+30 : DZOP "L",XC+30,YC+30 : DZOP "L",XC+20,YC+10
2440 REM Draw Long Crooked Nose
2450 DZOP "P", XC,YC+10 : DZOP "L",XC+10,YC-10 : DZOP "L",XC,YC-20
2460 REM Draw Crooked Mouth
2470 DZOP "P", XC-30,YC-30 : DZOP "L",XC-20,YC-35 : DZOP "L",XC-10,YC-30 : DZOP "L",XC+10,YC-35 : DZOP "L",XC+30,YC-30
2495 RETURN

3000 REM Pause Routine
3010 FOR PAUSE = 1 TO 300 : NEXT PAUSE : REM Short pause
3020 RETURN

4000 REM Move the WITCH to a new random position
4010 XC = INT(RND(1)*160) + 48 : YC = INT(RND(1)*120) + 48 : REM Random position within screen bounds (lowered Y range)
4020 RETURN

5000 REM Update the WITCH Color Scheme
5010 FC = FC + 1 : IF FC > 23 THEN FC = 17
5020 HC = HC + 1 : IF HC > 23 THEN HC = 17
5030 EC = EC + 1 : IF EC > 23 THEN EC = 17
5040 RETURN

9999 REM End of Program
10000 GOTO 10
