Mason’s Nerdy Icon  •  Stage 2: Refactored  •  09/08/2026
TNT Styl’n — Python Turtle Graphics Showcase

Mason’s Nerdy Icon — Refactored

Same artwork. Same turtle commands. Organized into constants, functions, and comments.
Stage 2: the upgrade. Open Stage 1 in another tab to compare side by side.

🐍  Stage 2 — Refactored

The Code, Organized

Every turtle command in this version is identical to Mason’s original. The output image is the proof. What changed is structure: hard-coded numbers became named constants, logical groups of commands became functions, and comments explain the purpose of each step.

  • Magic numbers like 75, 72.5, and 145 are now named constants: FACE_RADIUS, EYE_SPACING, BRIDGE_LENGTH.
  • Seven functions, one per facial feature: setup, draw_face, draw_glasses, draw_eyes, reposition_to_mouth, draw_mouth, draw_cheeks.
  • main() shows the entire draw order in seven lines — a high-level outline before any detail.
  • Inline comments explain why, not just what: # negative = clockwise quarter turn.

Output

Refactored output: the same nerdy emoji face as Stage 1 — identical artwork produced by the reorganized, commented code

Identical to Stage 1.
Same commands — better organized.

Original by Mason •  Refactored by GitHub Copilot (Claude) Artwork unchanged — structure upgraded

See How It Started

Stage 1 shows Mason’s original code exactly as written — 154 lines, no comments, no functions, no constants. Opening both pages side by side is the fastest way to see what modularization actually buys you: the output is the same, but the Stage 2 code can be understood, changed, and extended without re-reading the whole file.

Stage 1 — Original Code Open in New Tab