[Robot]
  Karel the Robot  

The Programming Errors


Start of task End of task

     #include <karel.h>
     using namespace std;
     int main()
     {
                          <-- TurnOn(); missing (execution error will result)
         Move();
         PickBeeber();    <-- misspelled word (lexical error)
         TurnLeft()       <-- no semicolon (syntactic error)
         PutBeeper();
         Move;            <-- parentheses missing (syntactic error)
                          <-- TurnOff(); missing (syntactic error)
         }
     }                    <-- extra curly brace (syntactic error)

* Error of Intent (aka Logic Error): Even if the errors noted above were fixed, Karel would make the mistake of depositing the beeper back on the original corner, rather than one block to the North as required.
[MTSU]  | CS  | [Home] Return to Karel home page
(Credits and Copyrights)