adafruit / Adafruit_CircuitPython_turtle

left! right! forward! turtle power!
MIT License
8 stars 12 forks source link

online turtle graphics example code defects #40

Open ricknun opened 2 weeks ago

ricknun commented 2 weeks ago

There are several problems in the CircuitPython version 9 example code at "Turtle Graphics in CircuitPython on TFT Gizmo" by John Park: https://learn.adafruit.com/turtle-graphics-gizmo/turtle-graphics-on-gizmo

I am using a Circuit Playground Bluefruit + TFT Gizmo + "Adafruit CircuitPython 9.1.4 on 2024-09-17" + the CircuitPython v9 code.py and \lib files from the example bundles. See the attached photos of Project Bundles "Star" (mis-rotated 90 degrees counter-clockwise), "Hilbert Curve" (incorrect origin), "Koch Snowflake" (incorrect origin), and "Christmas Tree" (tree mis-rotated 90 degrees, ornaments correct). Here are Cygwin diffs to show the changes I made to the 4 code.py files to make the images agree with those shown online.

diff _pre_mods_with_defects/turtle_christmas_tree.py turtle_christmas_tree.py
24a25
> turtle.right(90)

diff _pre_mods_with_defects/turtle_hilbert.py turtle_hilbert.py
54c54
< turtle.goto(-108, -108)
---
> turtle.goto(108, -108)

diff _pre_mods_with_defects/turtle_koch.py turtle_koch.py
34c34
< turtle.goto(-99, 56)
---
> turtle.goto(-56, -99)

diff _pre_mods_with_defects/turtle_star_fancy.py turtle_star_fancy.py
19a20
> turtle.right(90)

20241021_180320_resize 20241021_180752_resize 20241021_180823_resize 20241021_180855_resize

ricknun commented 11 hours ago

All 4 problems are fixed by adding turtle.mode("standard") to the example code. It appears the default turtle mode was changed from "standard" to "logo" since these example files were posted. Instead of changing all the example code I suggest changing the default mode back to "standard".

ricknun commented 11 hours ago

I also suggest as positively as possible, to do more regression testing before major releases. (:-)