Video summary
[알지오매스] 블록코딩으로 코흐눈송이 만들기(단계적용, 재귀함수 사용)
Main summary
Key takeaways
Main ideas / lessons
- The video shows how to construct a fractal using block coding with a turtle, building toward the well-known “Neko’s Snowflake” (a Koch-snowflake-style fractal).
- Instead of creating the fractal in one shot (which can be hard), the creator builds it incrementally:
- Builds the first segment (the “nose curve” / a basic Koch-like edge piece).
- Builds the second stage by applying the first stage as a reusable block and rotating copies.
- Builds the third stage using a recursive / n-step function approach, with careful handling of base cases to prevent “weird” stopping behavior.
- Extends toward stage 4, and optionally automates stage changes with a loop.
- A key concept is that:
- the overall curve is built from smaller pieces whose segment length increases by stage, while
- the overall size remains consistent, controlled by a scaling/division formula.
- The creator also discusses practical debugging/implementation tips, like checking each stage individually and using delete/rebuild workflows to avoid stacking artifacts.
Step-by-step methodology
Preparation / setup
- Use block coding with a turtle.
- Disable “Show Grid” to simplify the view.
- Define turtle movement rules with block actions such as:
- “move forward”
- “rotate left/right”
- duplicating blocks to build compound moves faster.
Step 1: Build the basic edge piece (Stage 1)
- Use a turtle that moves in a straight line to form a basic segment.
- Conceptually:
- The “overall size” is largely fixed by the turtle path length.
- What changes by stage is how the perimeter is subdivided—segments become smaller while the number of segments increases.
- Implementation goal for stage 1:
- Step 1 = move forward by 1 unit (in the creator’s naming), with higher-stage steps scaling subdivision effects.
Step 2: Build Stage 2 by rotating/copying Stage 1
- The stage-2 edge is created by:
- reusing the stage-1 movement block,
- applying rotations and duplications to construct the Koch-style pattern.
- Rotation behavior described:
- use patterns including rotate right by 60
- rotate left by 120
- plus additional right by 60 parts
- The creator manually demonstrates building the current stage by placing and duplicating movement/rotation blocks (e.g., duplicating “move 10,000…” for speed, then applying the rotation sequence to form the Koch-like order).
Step 3: Build Stage 3 using recursion / n-step function
- Recognize the structure:
- Stage 3 repeatedly uses the stage 2 pattern on each sub-portion of the curve.
- Implementation plan:
- Create a function at the bottom (a “function block”),
- then generate a new function block from it,
- parameterize recursion with an n steps setting (e.g., “n stages”).
- Execution order rule described for the n-step Koch-style recursion:
- when generating from stage m, the process effectively does:
- execute a sub-step (described like “2m-1st step” first),
- rotate 60° right,
- execute a later sub-step,
- rotate 120° left,
- execute another sub-step,
- rotate 60° right,
- execute again (described as the final “m-1st step”).
- when generating from stage m, the process effectively does:
- Important correction / base case handling:
- Naive recursion can cause drawing to stop or behave strangely (for example, when values reach 0 or negative, where rotations/moves don’t run as intended).
- The creator emphasizes adding/controlling conditions in the control block—e.g., only continue recursion while a condition like value > 1 holds.
- They also adjust the base movement so stage 1 behavior remains correct (so forward motion doesn’t become “too small” or disappear at recursion bottom-out).
- Simplified stage-3 build approach:
- For the “rotation part” at stage 3, use the curve as-is for base substitution.
- Ensure conditional logic prevents early termination at stage values like 0.
Scaling / keeping overall size consistent across stages
- Observed segment lengths across steps:
- Stage 1: forward by 1
- Stage 2: forward by 3
- Stage 3: forward by 9
- Scaling insight:
- the curve is divided by powers of 3 per stage (conceptually dividing by 3^(stage−1) or related).
- Implementation approach:
- introduce an extra variable named “Stage”,
- compute a scaling formula using powers of 3 and (Stage − 1) so segment lengths shrink/grow appropriately,
- ensure the overall snowflake size stays consistent.
- Note:
- Without correct scaling, stage 3/4 can become “broken” or have incorrect relative proportions.
Step 4: Add the remaining pieces to complete the snowflake (Stage 4 / full snowflake)
- After building the core curved edge, complete the snowflake by arranging three copies around the center (triangular symmetry).
- Rotation instructions described:
- rotate left by 50 (used to align the implementation’s starting direction),
- rotate up by 60,
- then rotate 120 to replicate outer triangle edges three times.
- Result:
- The “Neko snowflake” is completed mainly using stages 1–4.
Optional automation: compute multiple stages with a loop
- To change stages automatically:
- use a loop to iterate step 1 → step 4.
- Suggested approach:
- child iterations: use values 1 to 4
- when transitioning to step 4 (which contains step 3), adjust the stage variable (e.g., a stage-like variable such as “Tai” mentioned in the subtitles).
- Caution:
- inspecting stages is harder because stages stack visually on top of each other.
- to view each stage separately, use the control panel and wait/re-run.
Implementation / cleanup technique (to avoid stacking artifacts)
- If the program stacks repeatedly or becomes visually confusing:
- make the turtle/curve,
- then delete it,
- then make it again.
- Concrete workflow described:
- put the turtle back inside (the turtle object/agent),
- go to the “castle” area (workspace),
- delete all objects,
- place it at the top,
- press the “button” (referred to as “Honeymoon” in subtitles) to redraw tightly/wind up.
Speakers / sources featured
- No specific person’s name is explicitly stated (only a narrator/creator is implied).
- Referenced model/fractal:
- “Neko’s Snowflake”.