Many Karel exercises use a general Autograder that applies a set of test cases to each Karel program. Each test case looks for a specific aspect of the program, from its output and syntax to whether it calls a specific function a specific number of times.
While some Karel assignments may have custom test cases, most Karel exercises apply a general set of test conditions.
Below are the most common Karel Autograder messages if a specific test case fails:
Category | Autograder Error Message | Explanation |
General |
| This test runs the code and checks the ending world with each Result World. If all of the aspects are the same in both worlds (Karel’s location, number of tennis balls, color of the squares), then the program passes. |
General |
| This test checks for at least one command. If a program does not have at least one command, even if there is a function outline or control structure outline, the program fails the test. |
Syntax and Indentation |
| This test checks if all the commands end with a semicolon. |
Syntax and Indentation |
| This test checks for indentation. |
For Loop |
| This test checks if the program uses a for loop. |
Functions |
| This test checks all of the function definitions in a program. If a function definition does not have any commands inside of it, the program fails the test. |
Functions |
| This tests for a specific function definition by name. If there is a function with that exact name, the program will pass. |
Functions |
| This test checks if a specific function is called the correct number of times. If the function is not called or not called enough times, the program fails this test. |
Functions |
| This test checks for the proper naming convention for function names. If a function does not start with a lowercase letter, the program will fail this test. |
Functions |
| This test checks for the proper naming convention for function names. If a function starts with a capital letter, the program will fail this test. |
Functions |
| This test checks for nested functions. If there is a function written inside of another function, the program will not pass this test. |
SuperKarel and UltraKarel |
| This is a test that is specific to SuperKarel and UltraKarel. This test checks to see if there is a function named turnRight() or turnAround(). Because SuperKarel and UltraKarel know these commands, they are not necessary and the program fails the test. |
Still have questions? Ask your teacher to learn more!