At My Fingertips
Rapid Playground
Switzerland has an extensive hiking trail network with 65000 kilometers of signed hiking trails. There are three kinds of trails: hiking trails (marked in yellow), mountain hiking trails (marked in white-red-white), and alpine hiking trails (marked in white-blue-white).
The trails are signed with four kinds of signs, amongst them arrow-shaped hiking marks.
Let's compose those marks with PyTamaro!
The hiking trail mark is composed of a yellow arrow. The measurements are specified in the handbook of hiking trail signage published by Swiss Federal Office of Streets and the Swiss Hiking Trail Association. Here is the figure with the measaurements of a hiking trail mark:
The color is RAL 1007 "daffodil yellow", which in the RGB model consists of 232 red, 140 green, and 0 blue.
You probably saw a rectangle beside a triangle. That's great!
The measurement of the triangle are given by its width and height. But the PyTamaro triangle function expects two sides and the enclosed angle.
You may want to decompose the arrow's triangle into two right triangles (top and bottom half). Those you can construct given the width and half the height.
You can use the right_triangle
function from your toolbox
(if you don't have that function in your toolbox yet, you may want to do the
Triangles activity).
Mountain hiking trails consist of a red arrow, but also include white stripes. Here is the figure with the corresponding measaurements:
The two colors are:
The alpine hiking trail mark has the same structure as the mountain hiking trail mark. It simply uses different colors. Specifically, it uses blue instead of red for the arrow.
The two colors are:
You learned about one type of signage you encounter on the Swiss hiking trail network. This type of sign actually is quite rare; the other types are much more common.
You also (hopefully) practiced to structure your code so you can reuse functionality. The three marks are very similar. Did you manage to factor out the commonalities into separate functions?
This activity has been created by LuCE Research Lab and is licensed under CC BY-SA 4.0.
Swiss Hiking Marks
PyTamaro is a project created by the Lugano Computing Education Research Lab at the Software Institute of USI
Privacy Policy • Platform Version 1cd5229 (Tue, 05 Nov 2024 16:55:57 GMT)