Video summary
[알지오매스] 블록코딩으로 시어핀스키삼각형 만들기(단계적용, 재귀함수 사용)
Main summary
Key takeaways
Main ideas / lessons
- The video demonstrates how to draw the Sierpiński (시어핀스키) triangle using block-based programming (Blo Coding) with a turtle graphics approach.
- It upgrades a manual, step-by-step triangle drawing into a recursive/self-referencing function so the “small triangle” pattern repeats at smaller scales.
- It refines recursion control using variables and termination conditions so the triangle converges instead of recursing indefinitely.
- Finally, it adjusts the implementation so intermediate “stages” can be previewed (optionally with delays) and to prevent the program from getting overly heavy as stages increase.
Methodology / instructions (detailed)
1) Setup in Blo Coding (Turtle + grid)
- Open Blo Coding from the LMS screen.
- Add/insert a turtle sprite:
- In the turtle resources (Composition Club), use the 5th animation for the turtle.
- Move it to the 2nd Start block and click Run to display the turtle.
- Since the turtle is only used for drawing:
- Turn off/deactivate the plane element (if necessary).
- Keep the grid view on so later you can check distances/lengths.
2) Build the base triangle manually (non-recursive)
- “Create it because it’s Skip in 3”:
- In Actions, set movement to move forward 1 unit (the transcript mentions an equivalent like “move 2 forward by 1 unit”).
- Rotate to achieve the correct triangle angle:
- In Actions, rotate 120 degrees (instead of 60 degrees).
- Repeat the move/turn sequence:
- In Controls, set the repeated block to repeat 3 times.
Result: a basic equilateral triangle is created.
3) Build the “triangle-in-between” pattern (iterating smaller triangles)
- Goal (as described):
- Draw a large triangle first.
- Then draw smaller triangles in the gaps.
- Continue with continuously smaller triangles.
- Instead of rewriting everything:
- Right-click and use Repeat / Duplicate to create multiple copies of the small-triangle subprogram.
- Add a scaling step:
- Duplicate the small triangle structure and change its length to half the previous length.
- Ensure the small triangle is repeated 3 times (the transcript emphasizes “repeat this small triangle three times” for the interior placements).
Purpose: generate Sierpiński-style “emptiness” in the middle.
4) Replace manual repetition with a recursive/self-referencing function
- Introduce the function block (pink block at the bottom).
- Create a function that draws the Sierpiński triangle portion:
- Start by drawing a triangle of length 1.
- Recursion concept:
- Fractals have self-similarity, so the same process repeats at smaller scales.
- Implement it via a self-referencing function (a function calling itself).
- Add a variable parameter:
- Create a parameter/variable n to represent the scale/length level, so the function can accept different values later.
- Define recursion:
- After move/rotate steps for the current triangle,
- Call the function again with a reduced scale (the transcript indicates using n / 2 initially).
- Compute the new parameter using operations (e.g., divide by 2), using right-click → Duplicate where needed.
- Test:
- Run with a chosen example value like n = 4.
- Confirm the shrinking repeating pattern; it approaches an infinite fractal limit but stops based on the termination logic.
5) Add a stopping/termination condition using a control/operator block
- Ensure recursion stops when scale becomes small:
- The transcript describes a termination check like:
- “reflecting child being less than 10” and/or
- “until it is greater than 1” (wording is noisy, but the key is a threshold).
- The transcript describes a termination check like:
- Ensure the final drawing step order remains correct (move/rotate sequence):
- The transcript indicates ordering like move, rotate, move again, rotate, etc.
- Depth considerations:
- Increasing depth (e.g., “30,000”) can look similar at first, but correct termination logic is crucial for practical behavior.
6) Improve mathematical correctness: use exponent/power-of-2 scaling
- The speaker realizes the “n” handling should behave like exponent scaling.
- Instead of moving by n directly, use a power-of-2 interpretation and adjust recursion accordingly.
- Key insight:
- When you use exponents, halving length corresponds to subtracting exponents, so the recursive parameter update becomes an exponent decrement rather than a literal half-length computation.
- Update the recursive formula:
- Replace “divide-by-half” behavior with an exponent-based equivalent (described as changing to something like n - step).
7) Use stage/level variables to control shrinking and maintain large-to-small scaling
- Keep the large triangle length effectively constant while inner ones decrease appropriately.
- Introduce a variable:
- Stage
- Link n to Stage:
- Example shown: Stage set to 3.
- Adjust scaling to match exponent math:
- The transcript mentions expressions like 2 to the (square of the stage) (noisy, but exponent-based).
- Convert exponent subtraction into an operation such as:
- Replace exponent expressions with an operation like n - step so the total converges to 1 as intended.
8) Automate stage progression with a loop and optional timing (wait)
- Instead of manually changing step values:
- Use a loop to iterate through step values.
- Example behavior described:
- Set step from 1 up to around 1 (transcript is noisy; the intent is staged progression).
- For debugging/visualization:
- Add “wait 0.2 seconds” between stages to see them drawn sequentially.
- Performance:
- As stages increase, rendering can become heavy/laggy.
9) Clear and redraw stages to avoid heavy accumulation
- To keep the program lighter:
- After finishing Stage 1, delete everything before stage 2 and redraw stage 2.
- The transcript references a tool/block described as “4 Sins” (likely a clear/delete or scene-management block).
- Workflow:
- Delete elements after creating stage 1.
- Recreate stage 2 elements.
- Repeat per stage.
10) Final outcome
- The result is a Sierpiński triangle drawn using:
- Turtle movement,
- Recursion/self-referencing functions,
- Variable-controlled stage/scale,
- Loop-driven stage progression,
- And controlled termination conditions.
Speakers / sources featured (as stated or identifiable)
- [알지오매스] (channel/source in the video title)
- No individual person’s name is clearly and reliably stated in the subtitles (the transcript contains garbled names, but they are not clearly confirmable).