Skip to main content
All CollectionsResources for StudentsDebugging Your Code
For Students: Karel Autograder Messages
For Students: Karel Autograder Messages

Learn more about Autograder messages from Karel assignments and how to use them to debug your code.

Gareth Gebhardt avatar
Written by Gareth Gebhardt
Updated over 6 months ago

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.

Screenshot of an example of the Karel Autograder messages for a program with some errors in the code

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

Functionality: World _______

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

Style: You don’t have any commands in this program.

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

Style: You are missing a semicolon on the following lines:

This test checks if all the commands end with a semicolon.

Syntax and Indentation

Style: It looks like your indentation is off on line ___

This test checks for indentation.

For Loop

Style: You need to have a for loop in this problem.

This test checks if the program uses a for loop.

Functions

Style: You don't have any code in your functionName function. Make sure to use the function or get rid of it.

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

Style: You need to define a function called functionName.

This tests for a specific function definition by name. If there is a function with that exact name, the program will pass.

Functions

Style: Your code doesn't call the functionName function enough times.

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

Style: Some of your functions (FunctionName) do not start with a lowercase letter.

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

Style: Fix up your capitalization. Your function is named FunctionName but should be called functionName.

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

Style: You have a function function1 nested inside another function function2. Make sure to put your functions one after the other.

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

Style: You should not redefine turnRight()/turnAround() because SuperKarel already knows it.

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!

Did this answer your question?