Milestone 002: Square and Dashed Line #31

Merged
Tirsvad merged 3 commits from mil-002-square-and-dashed-line into mil-001-project-foundation 2026-10-07 18:42:19 +02:00
3 Commits
Author SHA1 Message Date
Tirsvad b3153b9dc1 Add the command line entry point
CI / checks (pull_request) Successful in 1m13s
python -m turtle_challenges <challenge> and the turtle-challenges command open a
window, run the named challenge and wait for a click. square and dashed-line are
registered; a missing Tk is reported with a hint instead of a traceback.

Task: MIL-002#6
2026-10-07 23:58:56 +08:00
Tirsvad a34bf6bbc2 Add draw_square and draw_dashed_line with tests
Challenge 1 draws four sides and turns right 90 degrees after each. Challenge 2 puts
the pen down for a dash and up for a gap and leaves it down at the end. Lengths and
counts come from constants.py; invalid values raise ValueError.

Task: MIL-002#3
Task: MIL-002#4
Task: MIL-002#5
2026-10-07 23:58:52 +08:00
Tirsvad e2249de46e Add the Pen protocol, window helpers and a recording fake turtle
The drawing functions take a Pen, the part of turtle.Turtle they use, so a test can
pass a fake that records every call. window.py is the only module that imports
turtle, and it does so inside the functions so that importing the package needs no Tk.

Task: MIL-002#1
Task: MIL-002#2
2026-10-07 23:58:50 +08:00