Skip to content

Commit 5a7f4f6

Browse files
docs: Improving README
1 parent 3092f76 commit 5a7f4f6

File tree

2 files changed

+30
-10
lines changed

2 files changed

+30
-10
lines changed

README.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ Import-Module ./ -Force -PassThru
5959

6060
Once we've imported Turtle, we can create any number of turtles, and control them with commands and methods.
6161

62-
#### Drawing Squares
62+
#### Drawing Simple Shapes
6363

6464
<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%' />
6767
</div>
6868

6969

@@ -96,6 +96,16 @@ $turtle.
9696
Symbol.Save("$pwd/Square.svg")
9797
~~~
9898

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+
99109
This just demonstrates how we can construct shapes out of these two simple primitive steps.
100110
We can also just say, make a square directly:
101111

README.md.ps1

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,15 @@ Import-Module ./ -Force -PassThru
8484
8585
Once we've imported Turtle, we can create any number of turtles, and control them with commands and methods.
8686
87-
#### Drawing Squares
87+
#### Drawing Simple Shapes
8888
8989
<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%' />
9696
</div>
9797
9898
@@ -133,6 +133,16 @@ $turtle.
133133
Symbol.Save("$pwd/Square.svg")
134134
~~~
135135
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+
136146
This just demonstrates how we can construct shapes out of these two simple primitive steps.
137147
'@
138148

0 commit comments

Comments
 (0)