Programming Assignments

 Chapter 3 Test: Thursday 10/26

Unit III: Decisions and Control Structures

Phase I: These programs are worth 40 points

Title

Description

Due Date

Harvesting Hole

Modify your Harvester robot so that it can harvest an area that contains missing beepers.  The robot does not know which beepers are missing and which are present.  Use the worlds hole1 and hole2 in order to test your code.  The robot MUST work in both worlds without any changes to the code.

Tuesday 10/10

Steeplechase

Create a new type of robot, Steeplechase.  The steeplechase robot needs to move from the origin (1,1) to the left side of the world (steeple1.kwld and steeple2.kwld).  In his way are hurdles of beepers that he needs to "climb" over.  The hurdles have either 1, 2, or 3 beepers.

Friday10/13

Carpet Small Rooms

A robot has been hired to carpet some "small rooms" along the bottom section of its world.  A "small room" is a corner that has a wall segment immediately to the west, north, and east.  The door is to the south.  Karel is to put a single beeper in only the "small rooms" and on no other corners.  You will need smallrooms.kwld and smallrooms2.kwld for this task.

Tuesday 10/17

Follow Wall Right

Create a new type of robot - Maze Robot.  We will be working with a number of different assignments in order to build a complete maze robot.  This assignment is to write a method, follow wall right.  The followWallRight method should assume that karel starts with a wall to his right.  The robot should then proceed to walk around the wall (regardless of its shape or size) continuously until he reaches a beeper.  You will need wall1.kwld from the share folder.

Thursday 10/19

GoToOrigin
Write a program that moves Karel from whatever his starting location is to 1,1.  I will have you test the program with more than one starting location.  Hint: use the left and bottom wall as boundaries.

Friday 10/20
SuperSteeple
Write a program that has Karel run a steeplechase.  The steeples are denoted using walls of arbitrary height and arbitrary width.  The race is not a set length.  There is a beeper at the end of the course to signal to karel that he should turn off.

Thursday 10/26

 

Phase II: These parts are worth 10 points each

 

Title

Description