Commit 14fb7997 authored by Alexander Belopolsky's avatar Alexander Belopolsky

Issue #7061: Added a 'Turtle star' sidebar

parent 922e904c
from turtle import *
color('red', 'yellow')
begin_fill()
while True:
forward(200)
left(170)
if abs(pos()) < 1:
break
end_fill()
done()
This diff was suppressed by a .gitattributes entry.
This diff is collapsed.
...@@ -23,6 +23,16 @@ command ``turtle.forward(15)``, and it moves (on-screen!) 15 pixels in the ...@@ -23,6 +23,16 @@ command ``turtle.forward(15)``, and it moves (on-screen!) 15 pixels in the
direction it is facing, drawing a line as it moves. Give it the command direction it is facing, drawing a line as it moves. Give it the command
``turtle.left(25)``, and it rotates in-place 25 degrees clockwise. ``turtle.left(25)``, and it rotates in-place 25 degrees clockwise.
.. sidebar:: Turtle star
Turtle can draw intricate shapes using programs that repeat simple
moves.
.. image:: turtle-star.*
:align: center
.. literalinclude:: ../includes/turtle-star.py
By combining together these and similar commands, intricate shapes and pictures By combining together these and similar commands, intricate shapes and pictures
can easily be drawn. can easily be drawn.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment