[kde-edu]: Recursion in KTurtle?

RalfGesellensetter rgx at gmx.de
Sat Oct 6 14:21:49 CEST 2007


Hi Matthias,

thanks for your sample...

Am Freitag 05 Oktober 2007 18:11 schrieb Matthias Messmer:
>   if x == 0 [
>    return 1
>   ]
>   else [

"else" is not known, but this way it works:

learn poweroftwo x [
  if x == 0  
     return 1  
  return 2 * poweroftwo x-1
  
]
clear
print poweroftwo 6


More information about the kde-edu mailing list