By JumpingTurtle a Logo language
Jun 12, 2015
JumpingTurtle a Logo language
Logo is a programming language intended for education. It includes instructions that allow to move a pointer leaving traces on the screen.
This pointer has the appearance of a turtle that can advance, turn to a certain angle etc.
The interest of this language is to teach young children programming. The purpose can be for example to find the instructions to obtain a drawing or guessing which picture is obtained with instructions.
I created a mini language logo for Windows in open source. I took a limited number of standard logo language instructions and I have changed some.
You can find at this address
I'll make it evolve so as to create artistic designs.
The key words of the language are the following
These instructions define and end are combined and used to define a block of instructions. The main block, called main must necessarily be defined in any program. The smallest program is:
But when run with the run button, the turtle does nothing!
However, with an instruction (walk 10) placed in the block, the turtle will move 10 units and leave a trace behind its passage.
Initially, the turtle is in the center of the screen and looks towards the top of the screen. This program will therefore move up 10 units (10 steps).
When you want to repeat the same course several times, it is useful to define other blocks of instructions.
Always with the instructions end and define, you can set another block before the main block and call with follow.
Give an example:
Trail line color
There are 142 colors for drawing and the background of the screen. The instruction color changes the color of the plot, while background changes the background color of the screen. Here are the color preceded by their number.
Some instructions are used to store the current position of the turtle, to recall the last saved position etc. In fact, the memory of the turtle is a stack.