Skip to content

Commit 9acd7b7

Browse files
Merge pull request #198 from PowerShellWeb/turtles-in-shape
Turtle 0.1.10
2 parents bab0d38 + 0221564 commit 9acd7b7

15 files changed

+935
-53
lines changed

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
## Turtle 0.1.10:
2+
3+
* Updated Methods
4+
* `Turtle.Star` even point fix (#190)
5+
* `Turtle.Polygon` partial polygon support (#194)
6+
* New Shapes
7+
* `Turtle.Rectangle` (#192)
8+
* `Turtle.StarFlower` (#191)
9+
* `Turtle.GoldenFlower` (#193)
10+
* `Turtle.HatMonotile` (#196)
11+
* `Turtle.TurtleMonotile` (#195)
12+
* `Turtle.BarGraph` (#173)
13+
* Added Demos
14+
* Intro To Turtles (#197)
15+
16+
---
17+
118
## Turtle 0.1.9:
219

320
* Turtle Text Path Support

Commands/Get-Turtle.ps1

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,54 @@ function Get-Turtle {
188188
$flowerPetals2,
189189
$flowerPetals
190190
)
191+
.EXAMPLE
192+
# We can create a Star with N points
193+
turtle star 42 5
194+
195+
turtle star 42 6
196+
197+
turtle star 42 7
198+
199+
turtle star 42 8
200+
.EXAMPLE
201+
# Stars look spectacular when we rotate and repeat them
202+
turtle @('star',42,5,'rotate',72 * 5)
203+
204+
turtle @('star',42,6,'rotate',60 * 6)
205+
206+
turtle @('star',42,7,'rotate',(360/7) * 7)
207+
208+
turtle @('star',42,8,'rotate',45 * 8)
209+
.EXAMPLE
210+
# When we do this, we call it a Star Flower
211+
turtle StarFlower 42
212+
.EXAMPLE
213+
turtle StarFlower 42 45 8 8
214+
.EXAMPLE
215+
turtle StarFlower 42 45 8 8
216+
.EXAMPLE
217+
# StarFlowers look spectacular when morphed
218+
turtle StarFlower 42 45 8 24 morph @(
219+
turtle StarFlower 42 45 8 24
220+
turtle StarFlower 42 15 8 24
221+
turtle StarFlower 42 45 8 24
222+
)
223+
.EXAMPLE
224+
# We can rotate the points we morph into.
225+
turtle StarFlower 42 45 8 24 morph @(
226+
turtle StarFlower 42 45 8 24
227+
turtle rotate (Get-Random -Max 360) StarFlower 42 15 8 24
228+
turtle StarFlower 42 45 8 24
229+
)
230+
.EXAMPLE
231+
# We can mix the number of points in a star flower morph
232+
#
233+
# (as long as we're drawing the same number of points)
234+
turtle StarFlower 42 12 5 30 morph @(
235+
turtle StarFlower 42 12 5 30
236+
turtle rotate (Get-Random -Max 360) StarFlower 42 14.4 6 25
237+
turtle StarFlower 42 12 5 30
238+
)
191239
.EXAMPLE
192240
# We can construct a 'scissor' by drawing two lines at an angle
193241
turtle Scissor 42 60
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Turtle 101 - Intro to Turtles
2+
3+
# Turtle is a groovy graphics system that dates back to 1966.
4+
5+
# Imagine you are a turtle holding a pen.
6+
7+
# You can:
8+
# * Turn
9+
# * Move Forward
10+
# * Pick up the pen
11+
12+
# Using these fundamental basics, we can theoretically draw any shape.
13+
14+
# Let's start simple, by drawing a line
15+
turtle forward 42 save ./line.svg
16+
17+
# Let's draw a line and take a few turns
18+
turtle forward 42 rotate 120 forward 42 rotate 120 forward 42 rotate 120 stroke '#4488ff' save ./triangle.svg
19+
20+
# Let's make a square
21+
turtle forward 42 rotate 90 forward 42 rotate 90 forward 42 rotate 90 forward 42 rotate 90 stroke '#4488ff' save ./square.svg
22+
23+
# Now let's do it the easier way, with square
24+
turtle square 42 stroke '#4488ff' save ./square2.svg
25+
26+
# Now let's do it the general way, with polygon
27+
turtle polygon 42 4 stroke '#4488ff' save ./square4.svg
28+
29+
# Our turtle is pretty smart, and so it can draw a lot of shapes for us.
30+
31+
# A classic example is a 'flower', which repeats many polygons
32+
turtle flower stroke '#4488ff' save ./flower.svg
33+
34+
35+
36+
37+

Turtle.psd1

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@{
22
# Version number of this module.
3-
ModuleVersion = '0.1.9'
3+
ModuleVersion = '0.1.10'
44
# Description of the module
55
Description = "Turtles in a PowerShell"
66
# Script module or binary module file associated with this manifest.
@@ -37,15 +37,21 @@
3737
# A URL to the license for this module.
3838
LicenseURI = 'https://github.com/PowerShellWeb/Turtle/blob/main/LICENSE'
3939
ReleaseNotes = @'
40-
## Turtle 0.1.9:
41-
42-
* Turtle Text Path Support
43-
* `Turtle.get/set_Text` controls the text (#167)
44-
* `Turtle.get/set_TextAttribute` sets text attributes (#168)
45-
* `Turtle.get/set_TextAnimation` animates text attributes (#171)
46-
* `Get-Turtle` parameter improvements (#169, #170)
47-
* `Get-Turtle` tracks invocation info (#157)
40+
## Turtle 0.1.10:
4841
42+
* Updated Methods
43+
* `Turtle.Star` even point fix (#190)
44+
* `Turtle.Polygon` partial polygon support (#194)
45+
* New Shapes
46+
* `Turtle.Rectangle` (#192)
47+
* `Turtle.StarFlower` (#191)
48+
* `Turtle.GoldenFlower` (#193)
49+
* `Turtle.HatMonotile` (#196)
50+
* `Turtle.TurtleMonotile` (#195)
51+
* `Turtle.BarGraph` (#173)
52+
* Added Demos
53+
* Intro To Turtles (#197)
54+
4955
---
5056
5157
Additional details available in the [CHANGELOG](https://github.com/PowerShellWeb/Turtle/blob/main/CHANGELOG.md)

0 commit comments

Comments
 (0)