File tree Expand file tree Collapse file tree 2 files changed +30
-10
lines changed Expand file tree Collapse file tree 2 files changed +30
-10
lines changed Original file line number Diff line number Diff line change @@ -59,11 +59,11 @@ Import-Module ./ -Force -PassThru
59
59
60
60
Once we've imported Turtle, we can create any number of turtles, and control them with commands and methods.
61
61
62
- #### Drawing Squares
62
+ #### Drawing Simple Shapes
63
63
64
64
<div align =' center ' >
65
-
66
- <img src='./Examples/Square.svg' alt='Square' width='50%' />
65
+
66
+ <img src =' ./Examples/Square.svg ' alt =' Square ' width =' 50% ' />
67
67
</div >
68
68
69
69
@@ -96,6 +96,16 @@ $turtle.
96
96
Symbol.Save("$pwd/Square.svg")
97
97
~~~
98
98
99
+ Or we could use a loop:
100
+
101
+ ~~~ PowerShell
102
+ $turtle = New-Turtle
103
+ foreach ($n in 1..4) {
104
+ $turtle = $turtle.Forward(10).Rotate(90)
105
+ }
106
+ $turtle | Save-Turtle ./Square.svg
107
+ ~~~
108
+
99
109
This just demonstrates how we can construct shapes out of these two simple primitive steps.
100
110
We can also just say, make a square directly:
101
111
Original file line number Diff line number Diff line change @@ -84,15 +84,15 @@ Import-Module ./ -Force -PassThru
84
84
85
85
Once we've imported Turtle, we can create any number of turtles, and control them with commands and methods.
86
86
87
- #### Drawing Squares
87
+ #### Drawing Simple Shapes
88
88
89
89
<div align='center'>
90
- $ (
91
- $null = Get-Turtle Square 10 |
92
- Set-Turtle - Property Stroke ' #4488ff' |
93
- Save-Turtle - Path ./ Examples/ Square.svg
94
- )
95
- <img src='./Examples/Square.svg' alt='Square' width='50%' />
90
+ $ (
91
+ $null = Get-Turtle Square 10 |
92
+ Set-Turtle - Property Stroke ' #4488ff' |
93
+ Save-Turtle - Path ./ Examples/ Square.svg
94
+ )
95
+ <img src='./Examples/Square.svg' alt='Square' width='50%' />
96
96
</div>
97
97
98
98
@@ -133,6 +133,16 @@ $turtle.
133
133
Symbol.Save("$pwd/Square.svg")
134
134
~~~
135
135
136
+ Or we could use a loop:
137
+
138
+ ~~~PowerShell
139
+ $turtle = New-Turtle
140
+ foreach ($n in 1..4) {
141
+ $turtle = $turtle.Forward(10).Rotate(90)
142
+ }
143
+ $turtle | Save-Turtle ./Square.svg
144
+ ~~~
145
+
136
146
This just demonstrates how we can construct shapes out of these two simple primitive steps.
137
147
'@
138
148
You can’t perform that action at this time.
0 commit comments