Category talk:Jq-turtle: Difference between revisions

Content added Content deleted
(def turtleMove())
Line 5: Line 5:
include "turtle" {search: "."};
include "turtle" {search: "."};
</pre>
</pre>

For an illustration of how to use the functions defined here, see
[[Koch_curve]].


<pre>
<pre>
Line 85: Line 88:
| turtleRotate(90);
| turtleRotate(90);


############################################################################

def svg($size):
"<svg viewBox=\"0 0 \($size) \($size)\" xmlns=\"http://www.w3.org/2000/svg\">",
.,
"</svg>";

def path($fill; $stroke; $width):
"<path fill=\"\($fill)\" stroke=\"\($stroke)\" stroke-width=\"\($width)\" d=\"\(.svg)\" />";

def draw($size):
path("none"; "red"; 1) | svg($size);

#################################################################################


def svg($size):
def svg($size):