Simple turtle graphics: Difference between revisions
Content added Content deleted
Thundergnat (talk | contribs) m (syntax highlighting fixup automation) |
(added graphic) |
||
Line 5: | Line 5: | ||
For a slightly more advanced audience, a more practical introduction to turtle graphics might be to draw a bar chart. |
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]] |
|||
See image here: https://i.imgur.com/B7YbTbZ.png |
|||
;Task: |
;Task: |
||
::* Create a function (or subroutine) that uses turtle graphics to draw a house of a specified size as |
::* 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. |
::* 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. |