• Home
• Contact Me
•
Aeries Portal
• Royal High School
• Simi Valley USD

AP Statistics

• Course Calendar
• Chapter Notes
• Practice Tests

AP Comp-Sci
Course Content
• Programs
• Practice Tests

CP Statistics
• Course Calendar
• Chapter Notes
• Practice Tests

Algebra
Geometry

Math Power

Computer Programming Unit 0 Programs
Karel J Robot

 Program 1-1: THS Beeper Parking Task Your task is to have Karel pick up the 3 beepers in the world, then "park" them in the "garages" as shown. He must also park himself, as shown. See the initial and final situations below. Karel may be faced in any direction when parked. Initial Situation                                    Final Situation        World File: first.wld                                                             BACK TO KAREL MAIN

 Program 2-1: The Newspaper Retrieval Task Every morning Karel is awakened in bed when the newspaper, represented by a beeper, is thrown on the front porch of his house. Program Karel to retrieve the paper  and bring it back to bed. See the initial situation below. World File: fig2-8.kwld Program 2-2: Plant the Flag! Karel has to scale a mountain, plant a flag, then descend the mountain on the other side. Karel must begin the task with a flag-beeper in his beeper bag. Karel must also follow the path shown in the diagram below - he is climbing, not flying! Initial Situation                                Final Situation World File: fig2-9.kwld                                                                      BACK TO KAREL MAIN Program 2-3: The Leaky Shopping Bag On the way home from grocery shopping, Karel's bag ripped open, leaking a few items. The items are represented by - you guessed it - beepers. Karel needs to go back and pick these items up and return to his starting position. See the initial situation below.                 World File: fig2-10.kwld                                                                     BACK TO KAREL MAIN Program 2-4: The Rearranger Karel must rearrange a column of beepers into a row of beepers. This requires picking the beepers up, then placing back down as seen in the example Note that the middle beeper does not change position. See the initial and final situations below. World File:fig2-11.kwld                                                                     BACK TO KAREL MAIN Program 2-5: The Initializer Karel must spell out your inititals using beepers. Make the initials at least 5 beepers high. See below for an example using my initials, DRS. Start with an infinite number of beepers (recall that is done with a -1).            World File: blank2.kwld                                                                         BACK TO KAREL MAIN

 Program 3-1: The StairClimber Class Karel must learn to climb stairs, picking up a beeper from each step. See the initial and final situations below.    World File: fig3-1.kwld                                                                     BACK TO KAREL MAIN Program 3-2: The ShelfStocker Class Karel just got a new job stocking grocery store shelves. He has to take the items off of the floor and place them on the shelf. He should begin and end the task at (1,1). See the initial and final situations below.            World File: shelf.kwld                                                                     BACK TO KAREL MAIN Program 3-3: The Harvester Class Karel must “harvest” a field of beepers. Each row of will consist of 5 beepers, and the number of rows will always be an even number. See the initial and final situations below.                            World File: fig3-2.kwld                                                                     BACK TO KAREL MAIN Program 3-4: The Planter Class Karel will be planting flowers in planter boxes. He will pick up 3 plants at the bottom of each planter box and then place them in a column in the boxes as shown in the example task below. Karel begins the task at (1, 1) facing East.             World File: planter.kwld                                                                       BACK TO KAREL MAIN Program 3-5: The Mover Class Karel is rearranging office furniture. he needs to move employees desks from one cubicle to the one adjacent to it. He will then move on and do the next desk, etc... . Beginning and ending situations are as shown below. Karel begins the task at (1, 3) facing East.            World File: mover.kwld                                                                         BACK TO KAREL MAIN Program 3-6: The Pinsetter Class Karel just got a job as a pinsetter at the local bowling alley. His job requires him to set up 10 pins in the normal configuration. See the initial and final situations below. World File: blank.kwld                                                                     BACK TO KAREL MAIN