Chapter 9

Recursion

Level: Medium



LOGO programming often uses a technic called recursion. In this chapter, first, we’ll explore recursion with some simple examples. Then, we’ll go further with the drawing of a fractal curve called the Van Koch snowflake“. First of all:

A procedure is recursive if it calls itself.


 9.1 With drawing area.

  9.1.1 First example:

  9.1.2 Second example:

 9.2 With the text zone

  9.2.1 First example:

  9.2.2 Breakout test

 9.3 A fractal example: Van Koch snowflake

 9.4 Recursion with words

 9.5 Calculate a factorial

 9.6 π Approximation