Skip to content

Commit 8eeeed0

Browse files
Merge pull request #163 from PowerShellWeb/turtle-performance
Turtle 0.1.8
2 parents 6402e9e + 71f71a9 commit 8eeeed0

22 files changed

+201
-103
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
## Turtle 0.1.8:
2+
3+
* Turtle Performance
4+
* Improving `.Steps` performance (#159)
5+
* Reducing Turtle Verbosity (#160)
6+
* New Moves:
7+
* Step (#161)
8+
* Forward,Teleport, and GoTo now use Step (#161)
9+
* New Reflection Examples (#162)
10+
11+
---
12+
113
## Turtle 0.1.7:
214

315
* Morphing Turtles

Commands/Get-Turtle.ps1

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ function Get-Turtle {
6464
.EXAMPLE
6565
# Let's make a triangle by multiplying steps
6666
turtle ('forward', 10, 'rotate', 120 * 3)
67+
.EXAMPLE
68+
# We can also write this with a polygon
69+
turtle polygon 10 3
6770
.EXAMPLE
6871
# Let's make a series of polygons, decreasing in size
6972
turtle polygon 10 6 polygon 10 5 polygon 10 4
@@ -87,6 +90,12 @@ function Get-Turtle {
8790
$sideCount
8891
}
8992
)
93+
.EXAMPLE
94+
# We can reflect a shape by drawing it with a negative number
95+
turtle polygon 42 3 polygon -42 3
96+
.EXAMPLE
97+
# We can change the angle of reflection by rotating first
98+
turtle rotate 60 polygon 42 3 polygon -42 3
9099
.EXAMPLE
91100
# We can morph any N shapes with the same number of points.
92101
turtle square 42 morph @(
@@ -95,14 +104,23 @@ function Get-Turtle {
95104
turtle square 42
96105
)
97106
.EXAMPLE
98-
# This animates the path of the turtle.
107+
# Reflections always have the same number of points.
108+
#
109+
# Morphing a shape into its reflection will zoom out, flip, and zoom back in.
110+
turtle polygon 42 6 morph @(
111+
turtle polygon -42 6
112+
turtle polygon 42 6
113+
turtle polygon -42 6
114+
)
115+
.EXAMPLE
99116
# If we want to morph a smaller shape into a bigger shape,
100-
# we can duplicate more lines
117+
#
118+
# we can duplicate lines
101119
turtle polygon 21 6 morph @(
102120
turtle @('forward', 21,'backward', 21 * 3)
103121
turtle polygon 21 6
104122
turtle @('forward', 21,'backward', 21 * 3)
105-
)
123+
)
106124
.EXAMPLE
107125
# We can repeat steps by multiplying arrays.
108126
# Lets repeat a hexagon three times with a rotation
@@ -304,6 +322,9 @@ function Get-Turtle {
304322
.EXAMPLE
305323
# The SierpinskiTriangle is a Fractal classic
306324
turtle SierpinskiTriangle 42 4
325+
.EXAMPLE
326+
# Let's draw two reflected Sierpinski Triangles
327+
turtle rotate 60 SierpinskiTriangle 42 4 SierpinskiTriangle -42 4
307328
.EXAMPLE
308329
# We can draw a 'Sierpinski Snowflake' with multiple Sierpinski Triangles.
309330
turtle @('rotate', 30, 'SierpinskiTriangle',42,4 * 12)

Examples/BoxFractal.svg

Lines changed: 1 addition & 1 deletion
Loading

Examples/EndlessBoxFractal.svg

Lines changed: 1 addition & 1 deletion
Loading

Examples/EndlessHilbert.svg

Lines changed: 1 addition & 1 deletion
Loading

Examples/EndlessScissorPoly.svg

Lines changed: 1 addition & 1 deletion
Loading

0 commit comments

Comments
 (0)