Hilbert curve: Difference between revisions
Content added Content deleted
(Added 4tH example) |
|||
Line 732: | Line 732: | ||
{{works with|4tH v3.62}} |
{{works with|4tH v3.62}} |
||
<lang forth>include lib/graphics.4th |
<lang forth>include lib/graphics.4th |
||
include lib/anstools.4th |
|||
64 constant /width \ hilbert curve order^2 |
64 constant /width \ hilbert curve order^2 |
||
Line 762: | Line 761: | ||
585 pic_width ! 585 pic_height ! \ set canvas size |
585 pic_width ! 585 pic_height ! \ set canvas size |
||
color_image 255 whiteout blue \ paint blue on white |
color_image 255 whiteout blue \ paint blue on white |
||
0 dup origin! \ set point of origin |
0 dup origin! \ set point of origin |
||
0 dup /width over dup hilbert \ hilbert curve, order=8 |
0 dup /width over dup hilbert \ hilbert curve, order=8 |
||
s" ghilbert.ppm" save_image \ save the image |
s" ghilbert.ppm" save_image \ save the image |
||
Line 768: | Line 767: | ||
Output: |
Output: |
||
''Since Rosetta Code doesn't seem to support uploads anymore, the resulting file cannot be shown.'' |
''Since Rosetta Code doesn't seem to support uploads anymore, the resulting file cannot be shown.'' |
||
=={{header|FreeBASIC}}== |
=={{header|FreeBASIC}}== |
||
{{trans|Yabasic}} |
{{trans|Yabasic}} |