L-system: Difference between revisions
Content added Content deleted
Thundergnat (talk | contribs) m (→{{header|Raku}}: Add a Raku example) |
(→{{header|Wren}}: Rabbit population example now uses new 'listSteps' method.) |
||
Line 277: | Line 277: | ||
=={{header|Wren}}== |
=={{header|Wren}}== |
||
{{libheader|Wren-lsystem}} |
{{libheader|Wren-lsystem}} |
||
{{libheader|Wren-fmt}} |
|||
The source code for the Wren-lsystem module is available on this site by clicking the above link and then navigating to the Talk page. |
The source code for the Wren-lsystem module is available on this site by clicking the above link and then navigating to the Talk page. |
||
Line 287: | Line 288: | ||
[], // constants |
[], // constants |
||
"I", // axiom |
"I", // axiom |
||
⚫ | |||
[ |
|||
Rule.new("I", "M"), |
Rule.new("I", "M"), |
||
Rule.new("M", "MI") |
Rule.new("M", "MI") |
||
] |
] |
||
⚫ | |||
) |
) |
||
System.print("Step String") |
System.print("Step String") |
||
System.print("---- --------") |
System.print("---- --------") |
||
var steps = lsys.listSteps(5) |
|||
for (i in 0..5) Fmt.print("$-4d $8m", i, |
for (i in 0..5) Fmt.print("$-4d $8m", i, steps[i])</syntaxhighlight> |
||
{{out}} |
{{out}} |