Skip to content

oonap0oo/Python-and-Turtle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python-and-Turtle

Projects using CPython and Turtle graphics

recursive_tree_turtle_random2.py

recursive_tree1.gif

Code: https://github.com/oonap0oo/Python-and-Turtle/blob/main/recursive_tree_turtle_random2.py

This script draws recursively generated trees.

A lot of the tree's parameters have random variation.

The code uses Turtle graphics for drawing and the timer function.

truchet_tiles2.py

truchet_tiles.gif

code: https://github.com/oonap0oo/Python-and-Turtle/blob/main/truchet_tiles2.py

This script shows a series of patterns of Truchet Tiles.

The tiles are drawn using the Turtle libary. All patters are made from 4 different tiles.

The patterns are defined as rows and columns of tile numbers, for this nested tuples are used:

pattern_X = (
    (2,4,3,4,4,2),
    (2,1,2,2,4,4),
    (3,4,4,2,2,4),
    (2,2,4,4,2,1),
    (4,2,2,4,3,4),
    (4,4,2,1,2,2)
    )

truchet_tiles2_random.py

truchet_tiles2_random.gif

Randomly generated Truchet Tiles using complementery tiles for pleasing result.

code of version which loops automatically through random patterns, mouse click stops script: truchet_tiles2_random.py

code of version which saves pattern to text file when key is pressed, loops to next random patterns with mouse click: truchet_tiles2_random_with_save.py

spiral.py

spiral.gif

code: https://github.com/oonap0oo/Python-and-Turtle/blob/main/spiral.py

An animated spiral effect using Turtle graphics

turtle_python_logo.py

turtle_python_logo_screenshot.png

Code: https://github.com/oonap0oo/Python-and-Turtle/blob/main/turtle_python_logo.py

This script defines a fucntion to draw an ellipse using Turtle graphics.

Turtle graphics does have a circle function but no ellipse.

The ellipse function is then used to draw a python logo suing Turtle graphics.

sierpinsky_turtle_cpython.py

sierpinsky_turtle_cpython_screenshot.png

code: https://github.com/oonap0oo/Python-and-Turtle/blob/main/sierpinsky_turtle_cpython.py

This script draws a Sierpinsky triangle recursively using turtle.

This one makes use extra functionality in CPython's turtle on the PC, such as drawing filled shapes.

The code shows several triangles using successively deeper recursion.

About

Projects using CPython and Turtle graphics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages