Tianbin-GitHub Page

This GitHub project provides GitHub Pages and Data Strucutres Python code in the same Repository.


Project maintained by TianbinLiu Hosted on GitHub Pages — Theme by nighthawkcodingsociety

Turtle Graphics

Example 1: Worlds and Turtles

<!-- return values... -->
<!-- functions return values -->
def newTurtle():
  w = makeWorld(500, 500)
  t = makeTurtle(w)
  return t

Moving turtles

<!-- Moving turtles -->
>>> t = newTurtle()
>>> t.forward()
>>> t.setBodyColor(red)
>>> t.setColor(red)
>>> t.turnRight()
>>> t.forward()
>>> t.setPenWidth(4)
>>> t.forward()

Information about each turtle

Example 2: Move turtles

Example 3: Simulation

Example 4: Simulation

Example 5: CSPTurtle

hide t

t.hideMe()

#run again (if enough time has lapsed) t.runAgain() ```

Wrapping up