An enterprising geyser gazer has created an app that will create a path for you to see eruptions of Old Faithful, Castle, Grand, Beehive, Riverside and Daisy geysers all in one day. It is not a simple path, and you’ll visit other features throughout the day. The gazer really loves turtle graphics and even created a mini-turtle language for drawing the path between the geysers. Unfortunately, you don’t have access to the mini-turtle runtime, so you’ll have to convert mini-turtle to python turtle, run the graph, and find the solution.
This table describes the mini-turtle language:
Mini-turtle | Python turtle | Example |
---|---|---|
beginfill | turtle.begin_fill() | |
color name | turtle.color(name) | color brown turtle.color(“brown”) |
coordinates a b c d | turtle.setworldcoordinates(a, b, c, d) | |
dot size color | turtle.dot(size, “color”) | dot 10 aqua turtle.dot(10, “aqua”) |
endfill | turtle.end_fill() | |
forward distance | turtle.forward(distance) | |
goto (x, y) | turtle.goto((x, y)) | goto (1, 2) turtle.goto((1, 2)) |
heading angle | turtle.setheading(angle) | |
left angle | turtle.left(angle) | |
pendown | turtle.pendown() | |
penup | turtle.penup() | |
right angle | turtle.right(angle) | |
text string fontname fontsize fonttype In the string parameter, spaces are replaced with underscores. |
turtle.write(string, font=(“fontname”, fontsize, “fonttype”)) | text Old_Faithful Arial 12 normal turtle.write(“Old Faithful”, font=(“Arial”, 12, “normal”)) |
width width | turtle.width(size) |
These are the geysers you will watch erupt:
Geyser | Coordinates | Abbreviation |
---|---|---|
Beehive Geyser | 375, 350 | BG |
Castle Geyser | 325, 200 | CG |
Daisy Geyser | 150, 100 | DG |
Grand Geyser | 300, 325 | GG |
Old Faithful | 400, 300 | OF |
Riverside Geyser | 100, 250 | RG |
The test input draws three trees:
The solution is formed by combining the abbreviations, in the order that you visit the geysers. For example, if you visited Beehive, Castle, Daisy, Grand, Old Faithful, and finally Riverside, then the solution would be:
BGCGDGGGOFRG
In what order did you see the geysers erupt?Copyright 2022 Robin A. Reynolds-Haertle