Turtle

Get-Turtle

Get-Turtle

Turtle Graphics in PowerShell

Turtle Graphics in PowerShell. Draw any image with turtles in a powershell.

Turtle Graphics are pretty groovy.

They have been kicking it since 1966, and they are how computers first learned to draw.

They kicked off the first computer-aided design boom and inspired generations.

They are also incredibly easy to build.

A Turtle graphic is described with a series of moves.

Let's start with the core three moves:

Imagine you are a Turtle holding a pen.

These are the three basic moves a turtle can make.

We can describe more complex moves by combining these steps.

As a PowerShell turtle, we can take any pipeline of objects and turn them into turtles.

Each argument can be the name of a method or property of the turtle object.

After a member name is encountered, subsequent arguments will be passed to the member as parameters.

We can write shapes as a series of steps. Let's start with a simple diagonal line

turtle rotate 45 forward 42

Let's draw an equilateral triangle

turtle forward 42 rotate 120 forward 42 rotate 120 forward 42

Typing that might get tedious. Instead, let's use a method. Polygon will draw an an N-sided polygon.

turtle polygon 10 5

There's also a method for squares

turtle square 42

If we rotate 45 degrees first, our square becomes a rhombus

turtle rotate 45 square 42

We can also draw a rectangle

turtle rectangle 42 4.2

If we only provide the first parameter, we get a golden rectangle

turtle rectangle 42

Circles

We can draw a circle

turtle circle 10

Or a pair of half-circles

turtle circle 10 0.5 rotate 90 circle 10 0.5

We can multiply arrays in PowerShell this can make composing complex shapes easier. Let's take the previous example and repeat it 8 times.

turtle @('circle',42,0.5,'rotate',90 * 8)

Let's make a triangle by multiplying steps

turtle ('forward', 10, 'rotate', 120 * 3)

We can also write this with a polygon

turtle polygon 10 3

Let's make a series of polygons, decreasing in size

turtle polygon 10 6 polygon 10 5 polygon 10 4

We can also use a loop to produce a series of steps Let's extend our previous example and make 9 polygons

turtle @(
    foreach ($n in 12..3) {
        'polygon'
        42
        $n
    }
)

We can use the same trick to make successively larger polygons

turtle @(
    $sideCount = 3..8 | Get-Random 
    foreach ($n in 1..5) {
        'polygon'
        $n * 10
        $sideCount
    }
)

We can reflect a shape by drawing it with a negative number

turtle polygon 42 3 polygon -42 3

We can change the angle of reflection by rotating first

turtle rotate 60 polygon 42 3 polygon -42 3

We can morph any N shapes with the same number of points.

turtle square 42 morph @(
    turtle square 42
    turtle rotate 45 square 42
    turtle square 42
)

Reflections always have the same number of points.

Morphing a shape into its reflection will zoom out, flip, and zoom back in.

turtle polygon 42 6 morph @(
    turtle polygon -42 6
    turtle polygon 42 6
    turtle polygon -42 6
)

If we want to morph a smaller shape into a bigger shape,

we can duplicate lines

turtle polygon 21 6 morph @(
    turtle @('forward', 21,'backward', 21 * 3)
    turtle polygon 21 6
    turtle @('forward', 21,'backward', 21 * 3)
)

We can repeat steps by multiplying arrays. Lets repeat a hexagon three times with a rotation

turtle ('polygon', 23, 6, 'rotate', -120 * 3)

Let's change the angle a bit and see how they overlap

turtle ('polygon', 23, 6, 'rotate', -60 * 6)

Let's do the same thing, but with a smaller angle

turtle ('polygon', 23, 6, 'rotate', -40 * 9)

Flowers

A flower is a series of repeated polygons and rotations

turtle Flower

Flowers look pretty with any number of polygons

turtle Flower 50 10 (3..12 | Get-Random) 36

Flowers get less dense as we increase the angle and decrease the repetitions

turtle Flower 50 15 (3..12 | Get-Random) 24

Flowers get more dense as we decrease the angle and increase the repetitions.

turtle Flower 50 5 (3..12 | Get-Random) 72

Flowers look especially beautiful as they morph

$sideCount = (3..12 | Get-Random)        
turtle Flower 50 15 $sideCount 36 morph @(
    turtle Flower 50 10 $sideCount 72
    turtle rotate (                
        Get-Random -Max 360 -Min -360
    ) Flower 50 5 $sideCount 72
    turtle Flower 50 10 $sideCount 72
)

Petals and Flowers

We can draw a pair of arcs and turn back after each one.

We call this a 'petal'.

turtle rotate -30 Petal 42 60

We can construct a flower out of petals

turtle FlowerPetal

Adjusting the angle of the petal makes our petal wider or thinner

turtle FlowerPetal 42 15 (20..60 | Get-Random) 24

Flower Petals get more dense as we decrease the angle and increase repetitions

turtle FlowerPetal 42 10 (10..50 | Get-Random) 36

Flower Petals get less dense as we increase the angle and decrease repetitions

turtle FlowerPetal 50 20 (20..72 | Get-Random) 18

Flower Petals look amazing when morphed

$Radius = 23..42 | Get-Random
$flowerAngle = 30..60 | Get-Random
$AngleFactor = 2..6 | Get-Random
$StepCount = 36
$flowerPetals =
    turtle rotate (
        (Get-Random -Max 180) * -1
    ) flowerPetal $radius 10 $flowerAngle $stepCount
$flowerPetals2 =
    turtle rotate (
        (Get-Random -Max 180)
    ) flowerPetal $radius (
        10 * $AngleFactor
    ) $flowerAngle $stepCount
turtle flowerPetal $radius 10 $flowerAngle $stepCount morph (
    $flowerPetals, 
    $flowerPetals2,
    $flowerPetals
)

Arcs and Suns

We can arc right or left

turtle arcRight 42 120
turtle arcLeft 42 120

We can arc right and then left to produce a ray or wave shape

turtle arcRight 42 120 arcLeft 42 120

We can rotate and repeat that rays to make a sun

$Length = 42
$Angle = 160
$RayAngle = 90
$StepCount = 9
turtle sun $Length $Angle $RayAngle $StepCount

If we reverse the ray angle and morph, the sun really shines!

turtle Sun 100 135 60 8 morph @(
    turtle Sun 100 135 60 8
    turtle Sun 100 135 -60 8
    turtle Sun 100 135 60 8
)

We can add multiple fixed colors to make a gradient Then the sun is truly bright.

turtle Sun 100 135 60 8 fill 'yellow' 'goldenrod' stroke 'goldenrod' 'yellow' morph @(
    turtle Sun 100 135 60 8
    turtle Sun 100 135 -60 8
    turtle Sun 100 135 60 8
)

Stars

We can create a Star with N points

turtle star 42 5
turtle star 42 6

turtle star 42 7

turtle star 42 8

Stars look spectacular when we rotate and repeat them

turtle @('star',42,5,'rotate',72 * 5)
turtle @('star',42,6,'rotate',60 * 6)

turtle @('star',42,7,'rotate',(360/7) * 7)

turtle @('star',42,8,'rotate',45 * 8)

Starflowers

When we do this, we call it a Star Flower

turtle StarFlower 42

turtle StarFlower 42 30 6 12

turtle StarFlower 42 (360/7) 7 7

turtle StarFlower 42 45 8 8

StarFlowers look spectacular when morphed

turtle StarFlower 42 45 8 24 morph @(
    turtle StarFlower 42 45 8 24
    turtle StarFlower 42 15 8 24
    turtle StarFlower 42 45 8 24
)

We can rotate the points we morph into.

turtle StarFlower 42 45 8 24 morph @(
    turtle StarFlower 42 45 8 24
    turtle rotate (Get-Random -Max 360) StarFlower 42 15 8 24
    turtle StarFlower 42 45 8 24
)

We can mix the number of points in a star flower morph

(as long as we're drawing the same number of points)

turtle StarFlower 42 12 5 30 morph @(
    turtle StarFlower 42 12 5 30
    turtle rotate (
        Get-Random -Max 360 -Min -360
    ) StarFlower 42 14.4 6 25
    turtle StarFlower 42 12 5 30
)

Scissors

We can construct a 'scissor' by drawing two lines at an angle

turtle Scissor 42 60

Drawing a scissor does not change the heading

We can create a zig-zag pattern by multiplying scissors

turtle @('Scissor',42,60 * 4)

Getting a bit more interesting, we can create a polygon out of scissors

We will continually rotate until we have turned a multiple of 360 degrees.

Turtle ScissorPoly 23 90 120

Turtle ScissorPoly 23 60 72

This can get very chaotic, if it takes a while to reach a multiple of 360

Let's build a dozen scissor polygons.

foreach ($n in 60..72) {
    Turtle ScissorPoly 16 $n $n
}

Step Spirals

We can draw an outward spiral by growing a bit each step

turtle StepSpiral

turtle StepSpiral 42 120 4 18

Because Step Spirals are a fixed number of steps,
they are easy to morph.

turtle StepSpiral 42 120 4 18 morph @(
    turtle StepSpiral 42 90 4 24
    turtle StepSpiral 42 120 4 24
    turtle StepSpiral 42 90 4 24            
)

turtle @('StepSpiral',3, 120, 'rotate',60 * 6)

turtle @('StepSpiral',3, 90, 'rotate',90 * 4)

Step spirals look lovely when morphed

(especially when reversing angles)

turtle @('StepSpiral',3, 120, 'rotate',60 * 6) morph @(
    turtle @('StepSpiral',3, 120, 'rotate',60 * 6)
    turtle @('StepSpiral',6, -120, 'rotate',120 * 6)
    turtle @('StepSpiral',3, 120, 'rotate',60 * 6)
)

When we reverse the spiral angle, the step spiral curve flips

turtle @('StepSpiral',3, 90, 'rotate',90 * 4) morph @(
    turtle @('StepSpiral',3, 90, 'rotate',90 * 4)
    turtle @('StepSpiral',3, -90, 'rotate',90 * 4)
    turtle @('StepSpiral',3, 90, 'rotate',90 * 4)
)

When we reverse the rotation, the step spiral curve slides

turtle @('StepSpiral',3, 90, 'rotate',90 * 4) morph @(
    turtle @('StepSpiral',3, 90, 'rotate',90 * 4)
    turtle @('StepSpiral',3, 90, 'rotate',-90 * 4)
    turtle @('StepSpiral',3, 90, 'rotate',90 * 4)
)

We we alternate, it looks amazing

turtle @('StepSpiral',3, 90, 'rotate',90 * 4) morph @(
    turtle @('StepSpiral',3, 90, 'rotate',90 * 4)
    turtle @('StepSpiral',3, 90, 'rotate',-90 * 4)
    turtle @('StepSpiral',3, 90, 'rotate',90 * 4)
    turtle @('StepSpiral',3, -90, 'rotate',90 * 4)
    turtle @('StepSpiral',3, 90, 'rotate',90 * 4)            
)

turtle @('StepSpiral',3, 120, 'rotate',60 * 6) morph @(
    turtle @('StepSpiral',3, 120, 'rotate',60 * 6)
    turtle @('StepSpiral',6, -120, 'rotate',120 * 6)
    turtle @('StepSpiral',3, 120, 'rotate',60 * 6)
    turtle @('StepSpiral',6, 120, 'rotate',-120 * 6)
    turtle @('StepSpiral',3, 120, 'rotate',60 * 6)
)

Spirolaterals

turtle spirolateral

turtle spirolateral 50 60 10

turtle spirolateral 50 120 6 @(1,3)

turtle spirolateral 23 144 8

turtle spirolateral 23 72 8

Bezier Curves

We can draw simple Bezier Curves. Imagine a string being tugged by a point

turtle bezierCurve 0 100 100 100

A morph can help us understand bezier curve movement

turtle bezierCurve 0 100 100 100 morph @(
    turtle bezierCurve 0 100 100 100
    turtle bezierCurve 100 0 100 100
    turtle bezierCurve 0 100 100 100
)

Lets make it more exaggerated

turtle viewbox 150 bezierCurve 0 100 100 100 morph @(
    turtle bezierCurve 0 200 100 100
    turtle bezierCurve 200 0 100 100
    turtle bezierCurve 0 200 100 100
)

We use the shorthand 's' for a simple bezier curve

turtle s 100 0 100 100

This helps make beautifully short moprhs

turtle s 100 0 100 100 morph @(
    turtle s 100 0 100 100
    turtle s 0 100 100 100
    turtle s 100 0 100 100
)

We can also draw quadratic bezier curves

turtle quadraticbezierCurve 0 100 100 100

We can use the alias q, and morph them, too.

turtle q 0 100 100 100 morph @(
    turtle q 100 0 100 100
    turtle q 0 100 100 100
    turtle q 100 0 100 100
)

We can also draw cubic bezier curves For these, imaging a string being pulled by two other strings.

turtle cubicBezierCurve 0 100 100 0 100 100

We can shorten this to c, and morph it in beautiful ways

turtle width 200 height 200 morph @(
    turtle c 0   0 0   0 200 200 
    turtle c 0 200 200 0 200 200 
    turtle c 0   0 0   0 200 200
    turtle c 200 0 0 200 200 200
    turtle c 0   0 0   0 200 200 
)
turtle width 200 height 200 start 200 200 morph @(
    turtle c 0    0 0    0 -200 200 
    turtle c 0  200 -200 0 -200 200 
    turtle c 0    0 0    0 -200 200
    turtle c -200 0 0  200 -200 200
    turtle c 0    0 0    0 -200 200 
)

We can start at a given location, and morph along an axis.

turtle width 200 height 200 morph @(
    turtle start 100 0 c 0 0 0 0 0 200
    turtle start 100 0 c -100 0 100 200 0 200
    turtle start 100 0 c 0 0 0 0 0 200
)

turtle width 200 height 200 morph @(
    turtle start 0 100 c 0 0 0 0 200 0
    turtle start 0 100 c 0 -100 200 100 200 0
    turtle start 0 100 c 0 0 0 0 200 0
)

Bar Graphs

Lets get practical. Turtle can easily make a bar graph.

turtle BarGraph 200 300 (1..10)

Want a vertical bar graph? Rotate first.

turtle rotate 90 BarGraph 200 300 (1..10)

Let's provide more random points:

turtle rotate 90 BarGraph 200 300 (1..20 | Get-Random -Count 20)

We can draw pretty pictures by connecting and rotating graphs

turtle @(
    'BarGraph', 200, 300, (1..10),
    'BarGraph', 200, 300, (10..1),
    'rotate',180 * 2
)

Pie Graphs

Want a Piece of Pie?

Turtle Pie 100 4
Turtle Pie 100 6
Turtle Pie 100 8

Want a quarter?

Turtle Pie 100 (1/4)

How about a range of slices?

Turtle Pie 100 (1..10)

What about some colorful slices?

Turtle Pie 100 @(
    foreach ($color in 'red', 'green', 'blue') {
        @{
            Value = 1
            PathClass = "$color-fill foreground-stroke"
            Fill = $color
            Title = $color
        }
    }
)
redgreenblue

What about some random colorful slices?

Turtle Pie 100 @(
    foreach ($color in 'red', 'green', 'blue', 'yellow', 'magenta','cyan') {
        @{
            Value = (Get-Random -Max 100)
            PathClass = "$color-fill foreground-stroke"
            Fill = $color
            Title = $color
        }
    }
)
redgreenblueyellowmagentacyan

Circle Arcs

Pie graphs are made out of circle arcs

Turtle id Quadrants @(
    'CircleArc',42, 90,
    'Rotate', 90 * 4
)
Turtle id Sextants @(
    'CircleArc',42, 60,
    'Rotate', 60 * 6
)
Turtle id Octants @(
    'CircleArc',42, 45,
    'Rotate', 45 * 8
)

We can alternate rotations and arcs to create radial stripes

Turtle 'Rotate', -22.5 @(
    'Rotate', 15,
    'CircleArc',42, 15,
    'Rotate', 15 * 24
)
Turtle 'Rotate', -15 @(
    'Rotate', 30,
    'CircleArc',42, 30,
    'Rotate', 30 * 12
)
    
Turtle @(
    'Rotate', 60,
    'CircleArc',42, 60,
    'Rotate', 60 * 6
)

We can draw negative circle arcs

Turtle CircleArc 42 -90

Negative quadrants

Turtle @(
    'CircleArc',42, -90,
    'Rotate', 90 * 4
)

Negative sextants

Turtle @(
    'CircleArc',42, -60,
    'Rotate', 60 * 6
)

Negative octants

Turtle @(
    'CircleArc',42, -45,
    'Rotate', 45 * 8
)

We can combine arcs and movement to make a pinwheel

turtle @(
    'circlearc', 42, 60,
    'rotate',60,
    'forward',42  * 6 
)

Lets morph positive quadrants into negative quadrants

$quadrants = Turtle @(
    'CircleArc',42, 90,
    'Rotate', 90 * 4
)
$quadrants | turtle morph @(
    $quadrants
    Turtle @(
        'CircleArc',42, -90,
        'Rotate', 90 * 4
    )
    $quadrants
)

Lets morph positive sextants into negative sextants

$sextants = Turtle id Sextants @(
    'CircleArc',42, 60,
    'Rotate', 60 * 6
)
$sextants | turtle morph @(
    $sextants
    Turtle @(
        'CircleArc',42, -60,
        'Rotate', 60 * 6
    )
    $sextants
)

Lets morph positive octants into negative octants

$octants = Turtle id Octants @(
    'CircleArc',42, 45,
    'Rotate', 45 * 8
)
$octants | turtle morph @(
    $octants
    Turtle @(
        'CircleArc',42, -45,
        'Rotate', 45 * 8
    )
    $octants
)

We can overlap pinwheels to make even more exotic shapes

turtle @(
    @(
        'circlearc', 21, -60,
        'rotate',60,
        'forward',42  * 6 
        'rotate', 30
    ) * 12
)

We can morph and spin these exotic shapes to create hypnotic animations

$exoticShape = turtle (
    @(                
        'circlearc', 21, -60,
        'rotate',60,
        'forward',42  * 6 
        
        'rotate', 30
    ) * 12
)
$exoticShape |
    turtle morph @(
        $exoticShape
        turtle (
            @(                
                'circlearc', 21, 60,
                'rotate',60,
                'forward',42  * 6 
                
                'rotate', 30
            ) * 12
        )
        $exoticShape
    ) pathAnimation @{
        type = 'rotate'
        values = 0, 360
        repeatCount = 'indefinite'
    }

Turtles all the way down

Turtles can contain turtles. Let's make a circle inscribed into a square

turtle viewbox 42 turtles ([Ordered]@{
    'square' = turtle square 42 
    'circle' = turtle circle 21
})

Each turtle can have a distinct color or CSS class

turtle viewbox 42 turtles ([Ordered]@{
    'square' = turtle square 42 pathclass 'blue-fill foreground-stroke'
    'circle' = turtle circle 21 pathclass 'cyan-fill foreground-stroke' 
})

Lets make some colorful boxes

turtle viewbox 42 turtles @([Ordered]@{
    'q1' = turtle start 0 0 square 21 pathclass 'red-fill foreground-stroke'
    'q2' = turtle start 21 0 square 21 pathclass 'green-fill foreground-stroke'
    'q3' = turtle start 21 21 square 21 pathclass 'yellow-fill foreground-stroke'
    'q4' = turtle start 0 21 square 21 pathclass 'blue-fill foreground-stroke'
})

Nested turtles can morph! Let's move these squares around.

turtle viewbox 42 turtles @([Ordered]@{
    'q1' = turtle viewbox 21 fill red pathclass 'red-fill foreground-stroke' morph @(
        turtle start 0 0 square 21
        turtle start 21 0 square 21
        turtle start 21 21 square 21
        turtle start 0 21 square 21
        turtle start 0 0 square 21
    )
    'q2' = turtle viewbox 21 fill green pathclass 'green-fill foreground-stroke' morph @(
        turtle start 21 0 square 21
        turtle start 21 21 square 21
        turtle start 0 21 square 21
        turtle start 0 0 square 21
        turtle start 21 0 square 21
    )
    'q3' = turtle viewbox 21 fill yellow pathclass 'yellow-fill foreground-stroke' morph @(
        turtle start 21 21 square 21
        turtle start 0 21 square 21
        turtle start 0 0 square 21
        turtle start 21 0 square 21
        turtle start 21 21 square 21
    ) 
    'q4' = turtle viewbox 21 fill blue pathclass 'blue-fill foreground-stroke' morph @(                
        turtle start 0 21 square 21
        turtle start 0 0 square 21
        turtle start 21 0 square 21
        turtle start 21 21 square 21
        turtle start 0 21 square 21
    )
})

Let's make a colorful cubic morph

$Colors = @('fill', '#4488ff','stroke','#224488','pathclass', 'brightBlue-fill','blue-stroke')
turtle width 200 height 200 turtles @(
    turtle morph @(
        turtle c 0   0 0   0 200 200 
        turtle c 0 200 200 0 200 200 
        turtle c 0   0 0   0 200 200
        turtle c 200 0 0 200 200 200
        turtle c 0   0 0   0 200 200 
    ) @colors
    turtle morph @(
        turtle c 0    0 0    0 -200 200 
        turtle c 0  200 -200 0 -200 200 
        turtle c 0    0 0    0 -200 200
        turtle c -200 0 0  200 -200 200
        turtle c 0    0 0    0 -200 200 
    ) @colors
    turtle morph @(
        turtle teleport 100 0 c 0 0 0 0 0 200
        turtle teleport 100 0 c -100 0 100 200 0 200
        turtle teleport 100 0 c 0 0 0 0 0 200
    ) @colors
    turtle morph @(
        turtle teleport 0 100 c 0 0 0 0 200 0
        turtle teleport 0 100 c 0 -100 200 100 200 0
        turtle teleport 0 100 c 0 0 0 0 200 0
    ) @colors
)

Webs

Turtle can draw webs

Turtle Spiderweb

Turtle can draw spiderwebs with any number of spokes and rings

Turtle Spiderweb 7 13

Turtle Spiderweb 7 13

We can draw random webs

$spokes = Get-Random -Min 3 -Max 13
$rings =  Get-Random -Min 3 -Max (13 * 3)
turtle web 42 $spokes $rings morph @(
    turtle web 42 $spokes $rings 
    turtle rotate (
        Get-Random -Max 360
    ) web 42 $spokes $rings 
    turtle web 42 $spokes $rings 
) stroke 'goldenrod' pathclass 'yellow-stroke'

We can draw a web with color and class

Turtle Spiderweb 7 13 stroke goldenrod pathclass 'yellow-stroke'

We can draw a random web with color and class

$spokes = Get-Random -Min 5 -Max 13
$rings  = Get-Random -Min 3 -Max (13 * 3)
turtle web 42 $spokes $rings morph @(
    turtle web 42 $spokes $rings 
    turtle rotate (
        Get-Random -Min 90 -Max 360
    ) web 42 $spokes $rings
    turtle web 42 $spokes $rings
) stroke goldenrod pathclass 'yellow-stroke'

L-Systems

Turtle can draw a number of fractals

turtle BoxFractal 42 4

We can make a Board Fractal

turtle BoardFractal 42 4

We can make a Crystal Fractal

turtle CrystalFractal 42 4

We can make ring fractals

turtle RingFractal 42 4

We can make a Pentaplexity

turtle Pentaplexity 42 3

We can make a Triplexity

turtle Triplexity 42 4

We can draw the Koch Island

turtle KochIsland 42 4

Or we can draw the Koch Curve

turtle KochCurve 42

We can make a Koch Snowflake

turtle KochSnowflake 42

We can draw the Levy Curve

turtle LevyCurve 42 6

We can use a Hilbert Curve to fill a space

Turtle HilbertCurve 42 4

We can use a Moore Curve to fill a space with a bit more density.

turtle MooreCurve 42 4

We can rotate and repeat moore curves, giving us even Moore.

turtle @('MooreCurve', 42, 4, 'Rotate', 90 * 4)

We can show a binary tree

turtle BinaryTree 42 4

We can make fractal plants

turtle FractalPlant 42 4

We can also make fractal shrubs

turtle FractalShrub 42 4

The SierpinskiArrowHead Curve is pretty

turtle SierpinskiArrowheadCurve 42 4

The SierpinskiTriangle is a Fractal classic

turtle SierpinskiTriangle 42 4

We can morph with no parameters to try to draw step by step

This will result in large files, and may not work in all browsers

For best results, adjust the precision

turtle SierpinskiTriangle 42 3 morph

Let's draw two reflected Sierpinski Triangles

turtle @(
    'rotate', 60
    'SierpinskiTriangle', 42, 4
    'SierpinskiTriangle', -42, 4
)

Now let's draw a dozen reflected Sierpinski Triangles

turtle @(
    'rotate', 60,
    'SierpinskiTriangle', 42, 4,
    'SierpinskiTriangle', -42, 4,
    'rotate', 30 *
        12
)

We can draw a 'Sierpinski Snowflake' with multiple Sierpinski Triangles.

turtle @('rotate', 30, 'SierpinskiTriangle',42,4 * 12)

turtle @('rotate', 45, 'SierpinskiTriangle',42,4 * 24)