'speed program execution
DEFINT A-Z
'lotsa color simple graphics
SCREEN 13
'draw the initial symbol
CIRCLE (160, 130), 30, 1
CIRCLE (160, 130), 50, 1
LINE (0, 0)-(319, 129), 0, BF
LINE (110, 130)-(130, 130), 1
LINE (190, 130)-(190, 70), 1
LINE (210, 130)-(210, 50), 1
LINE -(190, 50), 1
LINE -(160, 80), 1
LINE -(130, 50), 1
LINE -(110, 50), 1
LINE -(110, 110), 1
LINE -(130, 110), 1
LINE -(130, 70), 1
LINE -(160, 100), 1
LINE -(190, 70), 1

'outline it a little bit
FOR y = 0 TO 199
FOR x = 0 TO 319
IF POINT(x, y) = 1 THEN GOSUB outline
NEXT x
NEXT y

'outline it some more
FOR y = 0 TO 199
FOR x = 0 TO 319
IF POINT(x, y) = 9 THEN GOSUB outline2
NEXT x
NEXT y

'set it up to have a border and an edge
PAINT (160, 85), 14, 9
PAINT (160, 85), 0, 9

FOR y = 0 TO 199
FOR x = 0 TO 319
IF POINT(x, y) = 9 THEN PSET (x, y), 1
IF POINT(x, y) = 3 THEN PSET (x, y), 2
NEXT x
NEXT y

'save the initial image to a text file
OPEN "mj.pnt" FOR OUTPUT AS #1
FOR y = 0 TO 199
FOR x = 0 TO 319
IF POINT(x, y) > 0 THEN PRINT #1, x, y, POINT(x, y)
NEXT x
NEXT y
CLOSE #1

'setup colors and cool shading for the interior
PALETTE 255, 55 + 55 * 256 + 55 * 65536
FOR n = 0 TO 63
PALETTE n, n * 65536
PALETTE n + 64, n + n * 256
CIRCLE (160, 103), (63 - n) * 1.5, n
PAINT (160, 103), n, n
NEXT n

'load and map the initial image onto the cool shading
OPEN "mj.pnt" FOR INPUT AS #1
DO
INPUT #1, x, y, c
IF c = 1 THEN
        v = POINT(x, y)
        v = v * 3
        IF v > 63 THEN v = 63
        PSET (x, y), v + 64
END IF
IF c = 2 THEN PSET (x, y), 255
LOOP UNTIL EOF(1)
CLOSE #1
PAINT (0, 0), 255, 255
'wait until a key is hit to exit
'this is where you hit the print screen button and
'windows sends a copy of the screen to the clipboard
DO: LOOP WHILE INKEY$ = ""
END

'first outline sub
outline:
FOR a = -1 TO 1
FOR b = -1 TO 1
IF POINT(x + a, y + b) = 0 THEN PSET (x + a, y + b), 9
NEXT b
NEXT a
RETURN

'second outline sub
outline2:
FOR a = -1 TO 1
FOR b = -1 TO 1
IF POINT(x + a, y + b) = 0 THEN PSET (x + a, y + b), 3
NEXT b
NEXT a
RETURN

