hts.StevenWood.com

Karel 1

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 1: Using Objects

Complete the following in class or for homework. E-mail your java files (#1, 3, 4) and text file (#2) to -> <- as an attachment.

1.

Use the pattern for the Robot class as taught in class. Use the city file 'Chicago.txt' to create the city. Save the Chicago.txt file in the same folder as this project (not a subfolder).

Start karel, the robot, at avenue 5, street 6, facing North, with no things in its backpack, as shown (karel is the red arrowhead). Write instructions so that karel walks around the walls to pick up all of the things to its left (Hint: there is more than one thing) and continues around so that it returns to its starting position. It should stay close to the walls at all times.

Test your program thoroughly. Document your code properly.

2. Create your own pre-built city:
  • Check other examples (here  and here) of pre-built cities to see how to make yours.
  • Place several things in the city
  • You can build it in NetBeans (New File ->Other ->Empty File) etc.
 
3. Create your own robot activity:
  • Use your pre-built city
  • Have the robot pick up all the things and place them at the avenue 0 street 0
 
4. Create a NEW program that will modify ‘3’ and have two robots doing the work.  
 
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+