Milestone 003: Shapes and Random Color #32

Merged
Tirsvad merged 3 commits from mil-003-shapes-and-random-color into mil-002-square-and-dashed-line 2026-10-07 18:42:30 +02:00
Owner

Milestone 003: Shapes and Random Color

Adds random_color and the color palette, draw_shape and draw_shapes with their tests, and the shapes command.

Milestone document: mil-003-shapes-and-random-color.md. Its Go / No-Go criteria and tasks are the checklist for this pull request.

Stacked on #31: the base branch is mil-002-square-and-dashed-line. Retarget this pull request to main after #31 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

  • #22 (review against QC-PY-001): its record RC-016 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 #16
Closes #17
Closes #18
Closes #19
Closes #20
Closes #21

## Milestone 003: Shapes and Random Color Adds `random_color` and the color palette, `draw_shape` and `draw_shapes` with their tests, and the `shapes` command. Milestone document: [mil-003-shapes-and-random-color.md](https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/018-turtle/src/branch/mil-003-shapes-and-random-color/docs/milestones/mil-003-shapes-and-random-color.md). Its Go / No-Go criteria and tasks are the checklist for this pull request. Stacked on #31: the base branch is `mil-002-square-and-dashed-line`. Retarget this pull request to `main` after #31 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 - #22 (review against `QC-PY-001`): its record `RC-016` 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 #16 Closes #17 Closes #18 Closes #19 Closes #20 Closes #21
Tirsvad added this to the Milestone 003: Shapes and Random Color milestone 2026-10-07 18:15:08 +02:00
Tirsvad added 3 commits 2026-10-07 18:15:08 +02:00
random_color returns an immutable (red, green, blue) tuple of integers from 0 to 255
and random_palette_color picks a named color. Both take an optional random.Random
so that tests can seed them.

Task: MIL-003#1
Task: MIL-003#2
draw_shape turns 360 divided by the number of sides after each side and rejects
fewer than 3 sides. draw_shapes draws a triangle up to a decagon, each in a color
from the palette.

Task: MIL-003#3
Task: MIL-003#4
Task: MIL-003#5
Add the shapes challenge to the command line
CI / checks (pull_request) Successful in 1m7s
c695c47929
turtle-challenges shapes draws the polygons. The argument parsing tests already
cover every registered name.

Task: MIL-003#6
Tirsvad merged commit 9034aa1abb into mil-002-square-and-dashed-line 2026-10-07 18:42:30 +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#32