Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

Administrator / pygame_lesson5_diy1

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Snippets
  • Members
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Switch branch/tag
  • pygame_lesson5_diy1
  • a.py
Find file
BlameHistoryPermalink
  • BellCodeEditor's avatar
    save project · e8a3315b
    BellCodeEditor committed a year ago
    e8a3315b
a.py 400 Bytes
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
import turtle
pen=turtle.Turtle()
pen.color('sienna')
w=turtle.Screen()
w.bgcolor('wheat')
pen.left(90)
pen.up()
pen.backward(150)
pen.down()
def tree(n):
    if n>=50:
        pen .forward(n)
        pen.right(30)
        tree(n-50)
        pen.left(60)
        tree(n-50)
        pen.right(30)
        pen.up()
        pen.backward(n)
        pen.down()
tree(100)
turtle.done()