Creating Recursive Snowflakes

From basic recursion to fractal snowflake design

A guided tutorial for high school students using SWSnowFlake

Learning targets: By the end of this guide, you should be able to explain recursion in your own words, identify the base case in a recursive design, and intentionally build both Koch Crystal and Recursive Dendrite styles in the snowflake demo.

1) What Is Recursion?

Recursion means a process repeats the same rule on a smaller version of itself. In programming, this usually means a function calls itself.

function drawThing(size, depth) { if (depth === 0) { // Base case: stop here return; } // Draw one piece at this level drawPiece(size); // Recursive step: same function, smaller input drawThing(size * 0.6, depth - 1); }
Important: Every recursive design must shrink or simplify each step. If nothing gets smaller, it never stops.

2) Iterative vs Recursive Styles in SWSnowFlake

In the demo, some styles are loop-based and some are truly recursive:

Iterative styles use fixed lists of branch positions. Recursive styles generate details by repeated self-calls.

3) Koch Crystal: How It Grows

The Koch method starts with a segment and replaces the middle third with a triangular bump. Then it does the same replacement on each new segment.

DepthWhat You SeeHow Many Segment Replacements
0A simple straight arm0
1One triangular bump1
2Bumps on bumps4
3Clearly fractal edge16
4+Very detailed crystalline edge64 and up
Teacher move: Ask students to predict visual complexity before changing depth, then test and revise the prediction.

4) Recursive Dendrite: How It Grows

Recursive Dendrite grows like a tree branch: one trunk creates smaller branches at angles, and each of those branches repeats the same rule.

Small angle values make narrow, needle-like crystals. Larger angle values make wider, bushier crystals.

5) Guided App Recipes

Use the snowflake demo at SWSnowFlake Demo and try these exact settings.

Recipe A: Koch Intro
  • Style: Koch Crystal (Recursive)
  • Arms: 6
  • Recursion depth: 1
  • Radius: 5.5
  • Spin speed: 0
Recipe B: Koch Fractal Focus
  • Style: Koch Crystal (Recursive)
  • Arms: 6 or 8
  • Recursion depth: 3 or 4
  • Radius: 6.5
  • Spin speed: 10 to 25
Recipe C: Dendrite Basics
  • Style: Recursive Dendrite (Recursive)
  • Recursion depth: 2
  • Branch scale: 0.58
  • Branch angle: 30 to 35
  • Arms: 6
Recipe D: Dense Dendrite
  • Style: Recursive Dendrite (Recursive)
  • Recursion depth: 4
  • Branch scale: 0.65
  • Branch angle: 40 to 52
  • Border thickness: 0.6 to 1.2

6) Coaching Guide: How to Explore Intentionally

  1. Lock one variable: keep everything fixed except one slider.
  2. Run depth sweeps: test depth 0, 1, 2, 3, 4 and record observations.
  3. Compare algorithms: build one iterative and one recursive design with similar colors and radius.
  4. Add motion last: once shape behavior is understood, then add spin and SWBug motion.
Fast workflow tip: Use the Reset Rotation button or Shift+R often while testing recursive settings, so orientation does not distract from structure.

7) Practice Challenges

  1. Create two designs with the same depth but different branch scales. Describe exactly what changed.
  2. Build the "smallest" recursive snowflake that still looks clearly fractal.
  3. Recreate a design after closing the page using only your notes.
  4. Explain why depth 6 can feel slower than depth 3 in your own words.

8) Reflection Questions

Big takeaway: Recursion is not just a coding trick. It is a way of modeling growth and repeated structure in nature, geometry, and art.