CompSci 307 Fall 2021 |
Software Design and Implementation |
This language a simplified version of the one invented by Wally Feurzeig, Seymour Papert, and Cynthia Solomon at MIT that has been used to teach children to program all over the world.
Create an interactive development environment, IDE, that supports users to write basic Logo programs that produce drawings by moving a turtle around the screen with its pen down.
A Logo program is a set of instructions to control the current turtle(s) by moving them forwards, backwards, changing its heading, and showing/hiding them. In this way, drawings are created based on a turtle's state and that of its pen so it acts as a relative cursor, allowing users to understand geometry by imagining what they would do if they were the turtle (through body syntonic prediction and reasoning).
In addition to the UI features common to all applications, it should all allow the user to:
This is an example of a typical program:
Program Notes Output # draw a square fd 50 lt 90 fd 50 lt 90 fd 50 lt 90 fd 50
Move turtle forward 50 pixels (side 1)
Turn turtle left 90 degrees (right angle)
Move turtle forward 50 pixels (side 2)
Turn turtle left 90 degrees (right angle)
Move turtle forward 50 pixels (side 3)
Turn turtle left 90 degrees (right angle)
Move turtle forward 50 pixels (side 4)
More examples are given here, but you are expected to make your own example files as well (including ones with syntactically incorrect programs).
Name Description FD pixels Forward, moves current turtle(s) in its current heading by pixels distance BK pixels Back, moves current turtle(s) backward opposite its current heading by pixels distance LT degrees Left, turns current turtle(s) counterclockwise by degrees angle RT degrees Right, turns current turtle(s) clockwise by degrees angle PD Pen down, subsequent current turtle(s) moves leaves a visible trail PU Pen up, subsequent current turtle(s) moves do not leave any visible trail ST Show turtle, makes current turtle(s)'s graphical representation visible HT Hide turtle, makes current turtle(s)'s graphical representation invisible HOME Home, moves current turtle(s) to the center of the screen (0 0) STAMP Stamp, draw the current turtle(s) image in its current position and heading, so the image remains after its turtle moves away TELL turtle(s) Tell, sets turtles that will follow subsequent commands
note, if turtle has not previously existed, it is created and placed at the home location
General notes about a program's syntax:
Experiment with an in browser Logo environment.
Learn more about how the complete (and complex) Logo programming language works: