Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 14fb799

Browse files
committed
Issue #7061: Added a 'Turtle star' sidebar
1 parent 922e904 commit 14fb799

5 files changed

Lines changed: 20 additions & 0 deletions

File tree

Doc/includes/turtle-star.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from turtle import *
2+
color('red', 'yellow')
3+
begin_fill()
4+
while True:
5+
forward(200)
6+
left(170)
7+
if abs(pos()) < 1:
8+
break
9+
end_fill()
10+
done()

Doc/library/turtle-star.pdf

4.31 KB
Binary file not shown.

Doc/library/turtle-star.png

38.7 KB
Loading

Doc/library/turtle-star.ps

13.5 KB
Binary file not shown.

Doc/library/turtle.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,16 @@ command ``turtle.forward(15)``, and it moves (on-screen!) 15 pixels in the
2323
direction it is facing, drawing a line as it moves. Give it the command
2424
``turtle.left(25)``, and it rotates in-place 25 degrees clockwise.
2525

26+
.. sidebar:: Turtle star
27+
28+
Turtle can draw intricate shapes using programs that repeat simple
29+
moves.
30+
31+
.. image:: turtle-star.*
32+
:align: center
33+
34+
.. literalinclude:: ../includes/turtle-star.py
35+
2636
By combining together these and similar commands, intricate shapes and pictures
2737
can easily be drawn.
2838

0 commit comments

Comments
 (0)