Structural Recursion over the Natural Numbers

In this chapter we see our first major programming strategy for structuring computations: structural recursion over the natural numbers. That's quite a mouthful, so let's break it down:

Structural recursion means a recursion that follows the structure of the data it is processing. If the data is recursive (refers to itself) then the structural recursion will also refer to itself. We'll see in more detail what this means in a moment.

You will need to start your code with the following imports to make Doodle available.

import cats.effect.unsafe.implicits.global
import doodle.core.*
import doodle.image.*
import doodle.syntax.all.*
import doodle.image.syntax.all.*
import doodle.java2d.*