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
Owner

Milestone 002: Square and Dashed Line

Adds the Pen protocol and window helpers, a recording fake turtle for tests, draw_square and draw_dashed_line with their tests, and the command line entry point (turtle-challenges square and dashed-line).

Milestone document: mil-002-square-and-dashed-line.md. Its Go / No-Go criteria and tasks are the checklist for this pull request.

Stacked on #30: the base branch is mil-001-project-foundation. Retarget this pull request to main after #30 is merged; the Closes lines take effect only when it lands on main.

Verification

Before each commit: ruff format --check, ruff check, mypy, pytest and doxygen Doxyfile (0 warnings). Every commit that touches src/ or tests/ carries a Task: MIL-NNN#N trailer, and the plan-first commit hook passed without a bypass.

Not in this pull request

  • #15 (review against QC-PY-001): its record RC-015 ends in Go and is carried by #33, the last pull request of the stack, which closes the issue when it reaches main.

Issues

Closes #9
Closes #10
Closes #11
Closes #12
Closes #13
Closes #14

## Milestone 002: Square and Dashed Line Adds the `Pen` protocol and window helpers, a recording fake turtle for tests, `draw_square` and `draw_dashed_line` with their tests, and the command line entry point (`turtle-challenges square` and `dashed-line`). Milestone document: [mil-002-square-and-dashed-line.md](https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/018-turtle/src/branch/mil-002-square-and-dashed-line/docs/milestones/mil-002-square-and-dashed-line.md). Its Go / No-Go criteria and tasks are the checklist for this pull request. Stacked on #30: the base branch is `mil-001-project-foundation`. Retarget this pull request to `main` after #30 is merged; the `Closes` lines take effect only when it lands on `main`. ### Verification Before each commit: `ruff format --check`, `ruff check`, `mypy`, `pytest` and `doxygen Doxyfile` (0 warnings). Every commit that touches `src/` or `tests/` carries a `Task: MIL-NNN#N` trailer, and the plan-first commit hook passed without a bypass. ### Not in this pull request - #15 (review against `QC-PY-001`): its record `RC-015` ends in Go and is carried by #33, the last pull request of the stack, which closes the issue when it reaches `main`. ### Issues Closes #9 Closes #10 Closes #11 Closes #12 Closes #13 Closes #14
Tirsvad added this to the Milestone 002: Square and Dashed Line milestone 2026-10-07 18:15:05 +02:00
Tirsvad added 3 commits 2026-10-07 18:15:07 +02:00
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
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
Add the command line entry point
CI / checks (pull_request) Successful in 1m13s
b3153b9dc1
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
Tirsvad merged commit 5693856e92 into mil-001-project-foundation 2026-10-07 18:42:19 +02:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Tirsvad-Udemy-100-days-of-code/018-turtle#31