LGO-40 is a turtle graphics calculator with 40 keys (hence the name), each of them having a single purpose. That limits the number of features, but also makes operation very simple.
You can use LGO-40 in several different ways. For one thing, the lower half of the keyboard can be used on its own as an expression calculator:
1 * 2 + 3 * 4 + 5 * 6 + 7 * 8
(Press ENTER
to perform the calculation, and again to bring back the last calculation entered.)
But you can do more than that! Matrices, for instance:
REPEAT 5 [ SETCURSOR # * 5 0 PRINT # PRINT # * # PRINT # * # + # ]
(You can use a full arithmetic expression anywhere LGO-40 expects a number. Press SPACE
to separate adjacent numbers. Within a REPEAT
loop, #
stands for the current iteration number, starting from 1.)
For less regular numeric sequences, use FOREACH
:
FOREACH [ 3 5 7 ] [ PRINT [ # ? # + ? ] ]
(PRINT
can take either one number or else a list of numbers. Use the HOME
and CLEAN
commands to reset the text cursor and clear the screen, respectively.)
And then, of course, LGO-40 can do turtle graphics!
REPEAT 10 [ REPEAT 4 [ FORWARD 100 RIGHT 90 ] RIGHT 36 ]
The drawing commands are largely like in Berkeley Logo, except you set the pen mode with SETPENMODE
1, 2 or 3 for "paint", "erase" and "reverse", respectively. Also, SETPENSIZE
only takes one number.
Last but not least, you can of course combine text and graphics:
SETCURSOR 13 10 PRINT 1337 SETPENSIZE 10 SETPENMODE 3 RIGHT 100 FORWARD 50
It's just hard to align the text and graphics because they use different coordinate systems: the text cursor starts at 0 0 in the top left corner, for 20 rows and 25 columns, while the turtle's home is in the center of a 450x360 screen.
And that's about all. Enjoy!
(Last updated: 30 December 2016)