Configuring a Logo (Turtle) Problem
Turtle problems allow students to use the Python Turtle API to make programs that draw vector graphics.
Basic Configuration Details
These problems are configured with Language: Logo.
Marking a Logo problem requires using the
Python 3 Logo driver, with the
Logo Diff checker.
Beta: It is now possible to use the
Python 3 Function driver with the
Logo Diff checker. Care must be taken to configure the failure message template for this combination of driver / checker. Please ask us for assistance if you'd like to mark questions with this configuration.
You can include turtle commands in a special initial workspace file --
___turtle.py -- in order to set up the turtle world (if needed). These commands will be executed before any commands in
program.blockly) and will be saved (on a Terminal run) in the
logo-animation data used in an inline snippet.
___turtle.py workspace file needs to have the following File Settings to function correctly:
If using an inline snippet, it must have the following parameters:
Supported API Features
The following commands from the Turtle API are supported:
- Movement commands:
- Set position and heading:
- Shorthand drawing commands:
- World configuration:
- State information:
- Pen configuration:
- Turtle Appearance:
Creating Turtle Animations
___logo_finalrespectively. You can copy the contents by cmd+click'ing the Copy button in the editor. This allows you to specify the workspace filename to copy. Enter one of these two hidden filenames, and the contents of those hidden workspace files will be copied to their copy buffer. NOTE there is currently a bug that means you need to perform this copy operation twice before the clipboard is populated.
Author-only API Features (custom API)
Grok has added new API hooks to allow an author to use features that are not in the Python Turtle AP.
bgurl(image_url) -- Set the background to an image loaded via an asset URL. The background image should be 400 x 300 in size, to match the shape of the Turtle display window. Images that are smaller than this size will tile across the background. Use this api hook inside a
___turtle.py workspace file.