lantern

sprout-garden-phase-2

Sprout Garden Phase 2: Imprinting

Direct Assignment - Stamp a specific value

Overview

Phase 2 introduces imprinters - plots that stamp a specific form or color regardless of input. This teaches the difference between transformation (growers/bloomers) and assignment (imprinters).

This phase teaches: Sometimes you SET a value, sometimes you CHANGE a value.

Plot Types Introduced

Note: consider using outline shapes so that we don't indicate that colour as well as shape are stamped

From another goose:

One thing I notice: your symbols for form imprinters (πŸ”˜, πŸŸ₯, πŸ”Ί, ⭐) don't quite match the shape they produce. The red square emoji πŸŸ₯ is listed as outputting a square, but visually it's also red. Might confuse kids into thinking it's a color+shape imprinter. Could use outline versions or more abstract symbols to avoid that collision - or lean into it and make the emoji be the output shape+color, which would mean you need 16 form imprinters (4 shapes Γ— 4 colors as display symbols) even though they only affect shape.
Plot Symbol Category Seeds Fruits Behavior
Form Imprinter (●) πŸ”˜ transform all 4 pass-through Always outputs circle
Form Imprinter (β– ) πŸŸ₯ transform all 4 pass-through Always outputs square
Form Imprinter (β–²) πŸ”Ί transform all 4 pass-through Always outputs triangle
Form Imprinter (β˜…) ⭐ transform all 4 pass-through Always outputs star
Color Imprinter (πŸ”΄) πŸ”΄ transform all 4 pass-through Always outputs red
Color Imprinter (🟒) 🟒 transform all 4 pass-through Always outputs green
Color Imprinter (πŸ”΅) πŸ”΅ transform all 4 pass-through Always outputs blue
Color Imprinter (🟑) 🟑 transform all 4 pass-through Always outputs yellow

Key Distinction

Grower vs Imprinter

// Grower: advances one step in cycle
formGrower.grow(sprout) {
  return { ...sprout, shape: nextShape(sprout.shape) };
}

// Imprinter: stamps fixed value
circleImprinter.grow(sprout) {
  return { ...sprout, shape: 'circle' };
}

Programming Concept

Garden Code
Form Grower shape++ (increment)
Form Imprinter shape = 'circle' (assignment)

Level Ideas

Level Challenge Teaches
11 Use imprinter to fix shape Direct assignment
12 Reset after grower Assignment after transform
13 Choose right imprinter Decision making
14 Mixed growers and imprinters When to use which
15 Color + form imprinting Multiple properties

Source Files (To Be Created)

File Purpose
src/plots/types/form-imprinter.js Shape stamper (parameterized)
src/plots/types/color-imprinter.js Color stamper (parameterized)

API Documentation

files:
  - /Users/graemefawcett/working/ben.fawcett.family/activities/sprout-garden/src/plots/types/form-imprinter.js
  - /Users/graemefawcett/working/ben.fawcett.family/activities/sprout-garden/src/plots/types/color-imprinter.js

❌ Fence Execution Error: "'code-api-docs' - Down the rabbit hole we went, but that node doesn't exist! Try 'oculus list' to see what's available."

Implementation Notes

Imprinters can be implemented as parameterized plots:

// form-imprinter.js
export function createFormImprinter(targetShape) {
  return {
    id: `form-imprinter-${targetShape}`,
    name: `${targetShape} Imprinter`,
    symbol: SHAPE_SYMBOLS[targetShape],
    category: 'transform',
    phase: 2,
    seeds: ['left', 'right', 'up', 'down'],
    fruits: ['pass-through'],
    grow(sprout) {
      return { ...sprout, shape: targetShape };
    }
  };
}

// Register all form imprinters
export const circleImprinter = createFormImprinter('circle');
export const squareImprinter = createFormImprinter('square');
export const triangleImprinter = createFormImprinter('triangle');
export const starImprinter = createFormImprinter('star');

Pedagogy

What Kids Learn (Without Knowing It)

  • Assignment vs mutation: Setting a value vs changing it
  • Absolute vs relative: "Make it X" vs "Add 1"
  • Reset patterns: Using imprinters to "start over"
  • Tool selection: Choosing the right tool for the job

Verification

Live test results from [[sprout-garden-phase-2-test]]:

Test Status Details
form-imprinter.js exists fail not yet implemented
color-imprinter.js exists fail not yet implemented

Slots

North

slots:
- sprout-garden
- sprout-garden

South

slots:
- sprout-garden-phase-2-test

East

slots:
- sprout-garden-phase-3

West

slots:
- sprout-garden-phase-1
↑ northsprout-garden
↓ southsprout-garden-phase-2-test
β†’ eastsprout-garden-phase-3
← westsprout-garden-phase-1