Python/fractals
Tianyi Zheng 9f041e9cc8
Refactor sierpinski_triangle.py (#8068)
* updating DIRECTORY.md

* Update sierpinski_triangle.py header doc

* Remove unused PROGNAME var in sierpinski_triangle.py

The PROGNAME var was used to print an image description in the reference
code that this implementation was taken from, but it's entirely unused
here

* Refactor triangle() function to not use list of vertices

Since the number of vertices is always fixed at 3, there's no need to
pass in the vertices as a list, and it's clearer to give the vertices
distinct names rather than index them from the list

* Refactor sierpinski_triangle.py to use tuples

Tuples make more sense than lists for storing coordinate pairs

* Flip if-statement condition in sierpinski_triangle.py to avoid nesting

* Add type hints to sierpinski_triangle.py

* Add doctests to sierpinski_triangle.py

* Fix return types in doctests

* Update fractals/sierpinski_triangle.py

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2023-01-02 14:15:14 +01:00
..
julia_sets.py fix: no implicit optional (#7984) 2022-11-15 14:55:14 +01:00
koch_snowflake.py Add flake8 pluin flake8 bugbear to pre-commit (#7132) 2022-10-13 18:03:06 +02:00
mandelbrot.py Add flake8 pluin flake8 bugbear to pre-commit (#7132) 2022-10-13 18:03:06 +02:00
sierpinski_triangle.py Refactor sierpinski_triangle.py (#8068) 2023-01-02 14:15:14 +01:00