CS 161 Lab B - Turtle Graphics

Due Fri Sep 13 at 9:00am

Overview

In the late 60s, Seymour Papert at MIT developed a robot "turtle" to help teach young children to program. This robot has a small pen attached to it, which would draw a trail (a line) on a piece of paper as the robot moved and turned. Children could then program the robot's movement in order to have it draw a particular picture. This method of producing drawings is known as turtle graphics, versions of which can be found in pretty much every programming language.

In this lab, you will program a Java version of the robot to draw some simple images. This will give you a chance to continue practice writing Java code and calling methods on Java objects.

Remember that this lab should be completed in pairs. You will need to find a different partner than you had for the last lab. Be sure to review the pair programming guidelines before you begin; remember to switch off who is driving and who is navigating!

Objectives

Necessary Files

You will need to download and extract the Turtles BlueJ project from the LabB.zip file. This project includes Turtle class that has already been written for you, as well as a Pyramid class that you will need to fill in.

The Turtle

Below is a list of some of the methods that the turtle supports:

Assignment Details

For this lab, you will need to write programs that instruct a turtle on how to produce two different drawings. You can produce these programs in either order---but make sure you do them both!

1. The House

2. The Pyramid

Submission

Make sure both your names are on both the classes you've modified (HouseDrawing and Pyramid), and upload the entire project directory to the LabB submission folder on hedwig (see the previous lab if you need help). Only one partner needs to upload the code. Make sure you upload your work to the correct folder! The lab is due at the start of class the morning after lab.

After you have submitted your solution, log onto Moodle and submit the Lab B Partner Evaluation. Both partners need to submit evaluations.

Grading

This assignment will be graded on approximately the following criteria:

Remember that it is very easy to get partial credit, so turn in whatever you have before the lab's due date!