hts.StevenWood.com

Karel 6

Home ] Up ] Karel 1 ] Karel 1b ] Karel 2 ] Karel 2b ] Karel 3 ] Karel 4 ] Karel 5 ] Karel 5b ] [ Karel 6 ] Karel 6b ] Graphics: Types some words ] Graphics: Spell your name ] Graphics: Fall scene ][ Last Page ]

Karel 6

Complete the following in class or for homework.

1.

King Java's castle, shown in Figure 1, needs to be guarded. 

  1. (Not for this year.) Draw the class diagram of a GuardBot robot. Don't forget to show the various methods, etc. that are special to GuardBot.
  2. Write a GuardBot class, that extends RobotSE, to patrol the castle walls in the pattern shown. Choose an appropriate place for the guard to begin its duties. A GuardBot should travel all the way around the castle.
  3. Write a RobotTask application that uses four GuardBots to patrol the castle, start one on each side.
  4. Modify your solution so that all the guards patrol their wall simultaneously. Hint: use threads.

Test your programs thoroughly. Document your task code properly.

Do NOT hand in your work unless other instructions were given.

 

Here is the castle text file.
(Thanks Nicholas!)

YOU MUST adjust the size of the city IN the text file so you can see all of the castle and the robots WITHOUT having to resize the window. (Hint: look for the line near the top of the text file that indicates the number of streets and avenues.)

 
Home ] Up ] Karel 1 ] Karel 1b ] Karel 2 ] Karel 2b ] Karel 3 ] Karel 4 ] Karel 5 ] Karel 5b ] [ Karel 6 ] Karel 6b ] Graphics: Types some words ] Graphics: Spell your name ] Graphics: Fall scene ][Last Page]
All material on this site is copyright © 1997- by Steven Wood or as credited. All right reserved. Use of this site indicates you agreement with the  terms of use.
Send comments or questions to about this page.
Every attempt has been made to credit work under copyright. If there are any claims that copyright has been missed please contact the .
+SDG+