RosettaCodeData/Task/Simple-turtle-graphics/00-TASK.txt

14 lines
990 B
Plaintext

The first turtle graphic discussed in [https://mindstorms.media.mit.edu Mindstorms: Children, Computers, and Powerful Ideas] by Seymour Papert is a simple drawing of a house. It is a square with a triangle on top for the roof.
For a slightly more advanced audience, a more practical introduction to turtle graphics might be to draw a bar chart.
[[File:Turtle house and bar chart.png|thumb]]
;Task:
::* Create a function (or subroutine) that uses turtle graphics to draw a house of a specified size as depicted. Optionally make it lovely by adding details such as, for example, doors and windows.
::* Create a function (or subroutine) that takes a list (array, vector) of non-negative numbers and draws a bar chart from them, scaled to fit exactly in a square of a specified size. The enclosing square need not be drawn.
::* Both functions should return the turtle to the location it was at and facing in the same direction as it was immediately before the function was executed.