Sierpinski square curve: Difference between revisions
Content added Content deleted
(C++/Java/Rust - added links to output images) |
(Add Factor) |
||
Line 67: | Line 67: | ||
{{out}} |
{{out}} |
||
See: [https://slack-files.com/T0CNUL56D-F016R68SKR9-a10c02c762 sierpinski_square.svg] (offsite SVG image) |
See: [https://slack-files.com/T0CNUL56D-F016R68SKR9-a10c02c762 sierpinski_square.svg] (offsite SVG image) |
||
=={{header|Factor}}== |
|||
{{works with|Factor|0.99 2020-08-14}} |
|||
<lang factor>USING: accessors kernel L-system sequences ui ; |
|||
: square-curve ( L-system -- L-system ) |
|||
L-parser-dialect >>commands |
|||
[ 90 >>angle ] >>turtle-values |
|||
"F+XF+F+XF" >>axiom |
|||
{ |
|||
{ "X" "XF-F+F-XF+F+XF-F+F-X" } |
|||
} >>rules ; |
|||
[ |
|||
<L-system> square-curve |
|||
"Sierpinski square curve" open-window |
|||
] with-ui</lang> |
|||
When using the L-system visualizer, the following controls apply: |
|||
{| class="wikitable" |
|||
|+ Camera controls |
|||
|- |
|||
! Button !! Command |
|||
|- |
|||
| a || zoom in |
|||
|- |
|||
| z || zoom out |
|||
|- |
|||
| left arrow || turn left |
|||
|- |
|||
| right arrow || turn right |
|||
|- |
|||
| up arrow || pitch down |
|||
|- |
|||
| down arrow || pitch up |
|||
|- |
|||
| q || roll left |
|||
|- |
|||
| w || roll right |
|||
|} |
|||
{| class="wikitable" |
|||
|+ Other controls |
|||
|- |
|||
! Button !! Command |
|||
|- |
|||
| x || iterate L-system |
|||
|} |
|||
=={{header|Go}}== |
=={{header|Go}}== |