Logo - 递归程序

在递归过程中,将在过程中对过程进行重复调用.让我们考虑以下代码 :

to spiral_recur :n
   if :n < 1 [stop]
   fd :n
   rt 20
   spiral_recur 0.95 * :n
end

过程spiral_recur已从过程体本身调用.以下屏幕截图显示了代码的执行和输出.

递归程序