Computer Science 111 - Spring Semester, 2006

Homework #8 programming project

due: by midnight on Wednesday November 8

Part 1. Read Chapter 5

Part 2. Your task in this week's programming homework is to implement the Logo Programming Environment on top of the turtle graphics that you did in lab.

You'll need to write more than one function definition. I'll leave it up to you how to do it. But do not just define one big function for everything.

Also, the inputs are all strings (turtle commands or either the word 'list' or 'quit'). There should only be one call to raw_input(), at the end of the while loop <body>


In Logo, the user types in commands and a turtle shown graphically on the screen moves around and draws shapes, depending on what the user types in.

You can obtain a copy of a .pyc file for this program by typing
getcopy logo.pyc
Then in python
>>> import logo
>>> logo.main()
Remember that the .pyc file does not contain any Python statements. It is a binary file generated by the Python interpreter, that can be run by the interpreter later.

The list of turtle commands is, with n being an integer:

You can see a small demo to get the idea at this URL: http://www.klbschool.org.uk/ict/control/logo/logo05.htm

Here is how your program will work: