Dragon curve: Difference between revisions
Content deleted Content added
m →{{header|PicoLisp}}: Wrong comment |
Added 4tH version |
||
Line 523: | Line 523: | ||
home clear |
home clear |
||
10 45 dragon</lang> |
10 45 dragon</lang> |
||
=={{header|Forth}}== |
|||
{{works with|4tH}} |
|||
Basically the same code as the BigForth version. |
|||
[[file:4tHdragon.png|right|thumb|Output png]] |
|||
<lang forth>include lib/graphics.4th |
|||
include lib/gturtle.4th |
|||
2 constant dragon-step |
|||
: dragon ( depth dir -- ) |
|||
over 0= if dragon-step forward 2drop exit then |
|||
dup right |
|||
over 1- 45 recurse |
|||
dup 2* left |
|||
over 1- -45 recurse |
|||
right drop ; |
|||
150 pic_width ! |
|||
210 pic_height ! |
|||
color_image |
|||
clear-screen 50 95 turtle! |
|||
xpendown 13 45 dragon |
|||
s" 4tHdragon.ppm" save_image</lang> |
|||
=={{header|Go}}== |
=={{header|Go}}== |