Logo 2026-11-05
Logo is a programming language with procedures, lists and interactive evaluation, often used to make algorithmic ideas visible through turtle graphics. The turtle has a position and heading; motion commands can draw a line while changing that state. For example,
repeat 4 [forward 100 right 90] draws a square and returns to the initial heading. Each turn is an exterior angle, so a regular -gon uses turns of degrees.[ref]Berkeley Logo 6.2 User Manual by Brian Harvey. Graphics and Control Structures, FORWARD, RIGHT and REPEAT
A named procedure can package this instruction pattern and accept a side length as a parameter. Repeated calls and recursive procedures then produce more elaborate drawings without storing every line explicitly. The language also manipulates words and lists; turtle drawing is a useful experimental interface for studying programs, rather than the entire language.
Turtle graphics 2026-11-05
Turtle graphics draws through commands interpreted relative to a moving cursor's position and heading. A forward command moves along the current heading, a turn changes it, and pen state determines whether motion leaves a mark. The picture is the trace of a sequence of state changes, making geometric reasoning executable.[ref]
Berkeley Logo 6.2 User Manual by Brian Harvey. Graphics, FORWARD, RIGHT, PENUP and PENDOWN
In Logo,
repeat 4 [forward 100 right 90] draws a square and returns to the original heading and position. For a regular -sided polygon, each exterior turn is degrees, so the total turning is one full revolution. The same procedure works from a different initial position or heading, illustrating how local commands avoid specifying every absolute coordinate.