Docstoc

Karel++

Document Sample
Karel++ Powered By Docstoc
					Note: Original slides provided by www.apComputerScience.com
               and modified for this specific class           1
• Karel provides an OOP approach to learning
  computer science
• It provides visual feedback to students – you get to
  see your mistakes and triumphs.
• It will cover some of the major CS concepts in a
  short period of time:
   – Inheritance, Polymorphism, Abstraction, Encapsulation,
     OOP-Design, Recursion, Iteration, Selection, …
• Filters out many(relevant) details so one can focus
  on the major concepts:
   – Not in danger of losing sight of the Forest (computer
     science) through the details of the Trees (java details)


                                                                2
• It’s pure Java
• It introduces many major topics in a short
  period of time – not too much detail
   – then, as the year goes on, we will spiral back
     through those topics introducing more and more
     detail as required
• 7 Week timeframe which includes lectures,
  homework, labs, quizzes, and tests



                                                      3
• Robot World
  – A flat plane of streets (east-west) and AVenues
    (north-south)
               Streets




                                      Corner (many robots
                                      may occupy)
                         Avenues
                                                       4
• Bounded on west side by an an infinitely long
  vertical wall and on south side by infinitely long
  horizontal wall
• Streets and avenues have numbers
• Corner is identified by street and avenue. Origin is
  street 1, avenue 1.
• Position of robots and other things can be referred
  to by an absolute or relative location


                                                     5
• Contains Beepers and Walls
• Beepers
   – Beep very softly. Robots cannot sense a beeper until they
     are on the same corner.
   – May be picked up, carried, and placed again
   – Several beepers can be placed on a corner and they don’t
     interfere with Robot movement
• Walls
   – Placed half way between street corners
   – Impenetrable, blocks robots
   – Used to create rooms, mazes, hurdles

                                                                 6
7
• Moves
  – Only moves forward where top of its head is facing
• Turns                                              turned OFF.
                                               I am facing West
                                                   I can’t do
                                                  and have no
  – Turns 90 degrees to the left                    beepers
                                                 anything else.


• Senses surroundings
  – Hears beepers (on same corner)
  – Determines direction it is facing
• Picks up, carries, and puts down beepers
• Turns itself off

                                                            8
1. Factory - Builds the robots
                                              “factory”
  –   Standard model                          (auf
                                              Deutsch)
  –   New model
      • Extension of an existing base model
2. Factory – Delivers the robots




                                                          9
• Examples:
  – Move to a corner (3rd St. & 5th Ave.)
  – Run a hurdle race
  – Escape from a maze
  – Find a beeper and
    deliver it to the origin
  – Draw a pattern with
    beepers

                                            10
11
12

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:32
posted:2/25/2012
language:English
pages:12