DECLARE SUB load ()
DECLARE SUB cs ()
DECLARE SUB save ()
DECLARE SUB help ()
OPTION BASE 1
DIM SHARED program$(10000)
SCREEN 9: CLS
COLOR 2
PRINT "Small Logo 1.0 (based on Tiny Logo 2.0)": COLOR 3
PRINT "Written by Bit-jokey"
PRINT "(C) 2022 POWER HEAP RESEARCH"
PRINT "All rights reserved": COLOR 4
PRINT "Enter 'HELP' to get help"
LINE (1, 70)-(639, 349), 5, B
VIEW (2, 71)-(638, 348): SLEEP 5
in:
LOCATE 5, 1: PRINT "                        "
LOCATE 5, 1: LINE INPUT "Command> "; c$
n = n + 1
IF c$ = "help" OR c$ = "HELP" THEN CALL help: COLOR 4: GOTO in
IF c$ = "exit" OR c$ = "EXIT" THEN END
IF c$ = "cls" OR c$ = "CLS" THEN CALL cs: RUN
IF c$ = "save" OR c$ = "SAVE" THEN CALL save: GOTO in
IF c$ = "load" OR c$ = "LOAD" THEN CALL load: GOTO in
metka:
program$(n) = c$
DRAW c$
GOTO in

SUB cs
FOR n = 1 TO 10000
program$(n) = ""
NEXT n
END SUB

SUB help
LOCATE 7, 2: COLOR 15
PRINT "ώ Either of two prefix commands can precede any of the other"
LOCATE 8, 2
PRINT "  movement commands in stringexpression$:"
LOCATE 9, 2
PRINT "   B        Move, but do not plot any points."
LOCATE , 2
PRINT "   N        Plot, but return to original position when done."
LOCATE , 2
PRINT "ώ The following commands specify movement in terms of n units:"
LOCATE , 2
PRINT "   - The default unit size is one pixel."
LOCATE , 2
PRINT "   - Unit size can be modified by the S command, which sets the"
LOCATE , 2
PRINT "scale factor."
LOCATE , 2
PRINT "   - If no unit argument is supplied, the graphics cursor is moved"
LOCATE , 2
PRINT "one unit."
SLEEP
LOCATE 7, 2
PRINT "                                                                  "
LOCATE , 2
PRINT "                                                                  "
LOCATE , 2
PRINT "                                                                  "
LOCATE , 2
PRINT "                                                                  "
LOCATE , 2
PRINT "                                                                  "
LOCATE , 2
PRINT "                                                                  "
LOCATE , 2
PRINT "                                                                  "
LOCATE , 2
PRINT "                                                                  "
LOCATE , 2
PRINT "                                                                  "
LOCATE , 2
PRINT "                                                                  "
LOCATE , 2
PRINT "                                                                  "
LOCATE , 2
PRINT "                                                                  "
LOCATE , 2
PRINT "                                                                  "
LOCATE , 2
PRINT "                                                                  "
LOCATE , 2
PRINT "                                                                  "
LOCATE 7, 2
PRINT "  - The cursor-movement commands have the following effect:"
LOCATE 9, 2
PRINT "    Command        Effect"
LOCATE , 2
PRINT "    ΝΝΝΝΝΝΝΝΝΝΝ    ΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ"
LOCATE , 2
PRINT "    U[n]           Move up n units."
LOCATE , 2
PRINT "    D[n]           Move down n units."
LOCATE , 2
PRINT "    L[n]           Move left n units."
LOCATE , 2
PRINT "    R[n]           Move right n units."
LOCATE , 2
PRINT "    E[n]           Move diagonally up and right n units."
LOCATE , 2
PRINT "    F[n]           Move diagonally down and right n units."
LOCATE , 2
PRINT "    G[n]           Move diagonally down and left n units."
LOCATE , 2
PRINT "    H[n]           Move diagonally up and left n units."
LOCATE , 2
PRINT "    M[{+|-}]x,y    Move absolute or relative."
SLEEP
LOCATE 7, 2
PRINT "                                                                  "
LOCATE , 2
PRINT "                                                                  "
LOCATE , 2
PRINT "                                                                  "
LOCATE , 2
PRINT "                                                                  "
LOCATE , 2
PRINT "                                                                  "
LOCATE , 2
PRINT "                                                                  "
LOCATE , 2
PRINT "                                                                  "
LOCATE , 2
PRINT "                                                                  "
LOCATE , 2
PRINT "                                                                  "
LOCATE , 2
PRINT "                                                                  "
LOCATE , 2
PRINT "                                                                  "
LOCATE , 2
PRINT "                                                                  "
LOCATE , 2
PRINT "                                                                  "
LOCATE , 2
PRINT "                                                                  "
LOCATE , 2
PRINT "                                                                  "
LOCATE 7, 2
PRINT " - If x is preceded by a plus (+) or minus"
LOCATE , 2
PRINT "   (-), the movement is relative to the"
LOCATE , 2
PRINT "   current point. The x and y are added to"
LOCATE , 2
PRINT "   (or subtracted from) the coordinates of"
LOCATE , 2
PRINT "   the current graphics position and"
LOCATE , 2
PRINT "   movement is to that point."
LOCATE , 2
PRINT " - If no sign precedes x, the movement is"
LOCATE , 2
PRINT "   absolute. Movement is from the current"
LOCATE , 2
PRINT "   cursor position to the point with"
LOCATE , 2
PRINT "   coordinates x, y."
LOCATE , 2
PRINT " HELP - this help."
LOCATE , 2
PRINT " EXIT - exit to operating system."
LOCATE , 2
PRINT " CLS - clear screen"
LOCATE , 2
PRINT " SAVE - save file"
LOCATE , 2
PRINT " LOAD - load file"
SLEEP
LOCATE 7, 2
PRINT "                                                                  "
LOCATE , 2
PRINT "                                                                  "
LOCATE , 2
PRINT "                                                                  "
LOCATE , 2
PRINT "                                                                  "
LOCATE , 2
PRINT "                                                                  "
LOCATE , 2
PRINT "                                                                  "
LOCATE , 2
PRINT "                                                                  "
LOCATE , 2
PRINT "                                                                  "
LOCATE , 2
PRINT "                                                                  "
LOCATE , 2
PRINT "                                                                  "
LOCATE , 2
PRINT "                                                                  "
LOCATE , 2
PRINT "                                                                  "
LOCATE , 2
PRINT "                                                                  "
LOCATE , 2
PRINT "                                                                  "
LOCATE , 2
PRINT "                                                                  "
LOCATE 7, 2
PRINT "Command  Description  Range of values           Comments"
LOCATE , 2
PRINT "ΝΝΝΝΝΝΝ  ΝΝΝΝΝΝΝΝΝΝΝ  ΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ  ΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ"
LOCATE , 2
PRINT "A n      Set angle    n = 0 to 3, where         Figures rotated 90ψ or"
LOCATE , 2
PRINT "         rotation                 0 is 0ψ,      270ψ are scaled so they"
LOCATE , 2
PRINT "                                  1 is 90ψ,     appear the same size"
LOCATE , 2
PRINT "                                  2 is 180ψ,    on a monitor screen"
LOCATE , 2
PRINT "                                  3 is 270ψ.    with a 4:3 aspect ratio."
LOCATE , 2
PRINT
LOCATE , 2
PRINT "TA n     Turn an      -360 <= n <= 360          If n is positive, coun-"
LOCATE , 2
PRINT "         angle                                  terclockwise rotation."
PRINT
SLEEP
LOCATE 7, 2
PRINT "                                                                           "
LOCATE , 2
PRINT "                                                                            "
LOCATE , 2
PRINT "                                                                            "
LOCATE , 2
PRINT "                                                                            "
LOCATE , 2
PRINT "                                                                              "
LOCATE , 2
PRINT "                                                                           "
LOCATE , 2
PRINT "                                                                          "
LOCATE , 2
PRINT "                                                                  "
LOCATE , 2
PRINT "                                                                  "
LOCATE , 2
PRINT "                                                                  "
LOCATE , 2
PRINT "                                                                  "
LOCATE , 2
PRINT "                                                                  "
LOCATE , 2
PRINT "                                                                  "
LOCATE , 2
PRINT "                                                                  "
LOCATE , 2
PRINT "                                                                  "
LOCATE 7, 2
PRINT "S n      Set scale    1 <= n <= 255             Set scale factor n,"
LOCATE , 2
PRINT "                                                which can range from 0"
LOCATE , 2
PRINT "                                                to 255, inclusive."
LOCATE , 2
PRINT "                                                Increase or decrease"
LOCATE , 2
PRINT "                                                length of moves. The"
LOCATE , 2
PRINT "                                                default for n is 4,"
LOCATE , 2
PRINT "                                                which causes no scaling."
LOCATE , 2
PRINT "                                                The scale factor"
LOCATE , 2
PRINT "                                                multiplied by movement-"
LOCATE , 2
PRINT "                                                Command arguments"
LOCATE , 2
PRINT "                                                (divided by 4) gives"
LOCATE , 2
PRINT "                                                the actual distance"
LOCATE , 2
PRINT "                                                moved."
LOCATE , 2
PRINT "C n      Set color                              Set current color."
LOCATE , 2
SLEEP
LOCATE 7, 2
PRINT "                                                                        "
LOCATE , 2
PRINT "                                                                        "
LOCATE , 2
PRINT "                                                                       "
LOCATE , 2
PRINT "                                                                       "
LOCATE , 2
PRINT "                                                                       "
LOCATE , 2
PRINT "                                                                         "
LOCATE , 2
PRINT "                                                                        "
LOCATE , 2
PRINT "                                                                          "
LOCATE , 2
PRINT "                                                                          "
LOCATE , 2
PRINT "                                                                       "
LOCATE , 2
PRINT "                                                                        "
LOCATE , 2
PRINT "                                                                       "
LOCATE , 2
PRINT "                                                                       "
LOCATE , 2
PRINT "                                                                        "
LOCATE , 2
PRINT "                                                                          "
LOCATE 7, 2
PRINT "P p,b                                           p is the paint color"
LOCATE , 2
PRINT "                                                for a figure's interior,"
LOCATE , 2
PRINT "                                                while b is the"
LOCATE , 2
PRINT "                                                paint color for the"
LOCATE , 2
PRINT "                                                figure's border."
SLEEP
LOCATE 7, 2
PRINT "                                                                        "
LOCATE , 2
PRINT "                                                                        "
LOCATE , 2
PRINT "                                                                       "
LOCATE , 2
PRINT "                                                                       "
LOCATE , 2
PRINT "                                                                       "
LOCATE , 2
PRINT "                                                                         "
LOCATE , 2
PRINT "                                                                        "
LOCATE , 2
PRINT "                                                                          "
LOCATE , 2
PRINT "                                                                          "
LOCATE , 2
PRINT "                                                                       "
LOCATE , 2
PRINT "                                                                        "
LOCATE , 2
PRINT "                                                                       "
LOCATE , 2
PRINT "                                                                       "
LOCATE , 2
PRINT "                                                                        "
LOCATE , 2
PRINT "                                                                          "
LOCATE 7, 2
END SUB

SUB load
CALL cs
n = 1
LOCATE 5, 1: PRINT "                        "
LOCATE 5, 1: LINE INPUT "Filename> "; file$
OPEN file$ FOR INPUT AS #1
WHILE EOF(1) <> -1
LINE INPUT #1, p$
program$(n) = p$
DRAW p$
n = n + 1
WEND
CLOSE #1
LOCATE 5, 1: PRINT "                        "
LOCATE 5, 1: PRINT "File loaded": SLEEP 5
END SUB

SUB save
LOCATE 5, 1: PRINT "                        "
LOCATE 5, 1: LINE INPUT "Filename> "; file$
OPEN file$ FOR OUTPUT AS #1
FOR n = 1 TO 10000
IF program$(n) <> "" THEN PRINT #1, program$(n)
NEXT n: CLOSE #1
LOCATE 5, 1: PRINT "                        "
LOCATE 5, 1: PRINT "File saved": SLEEP 5
END SUB