Thread: recursive code
View Single Post
recursive code
Posts: n/a
Default recursive code - 11-18-2010, 01:36 PM

I need help understanding recursive code. I completed the Towers exercise as written in the book; and although it works, I do not understand why (to me the IF statement should execute once then stop, but the ELSE part executes until everything is finished???). My teacher also said the world.moveIt method could be shortened by using recursive code, but I am not sure how to accomplish that.
Could someone please explain in detail why the code works and perhaps provide some other examples and explainations?

PS: I have attatched the Towers file just in case you are using a different book.
Attached Files
File Type: a2w TowersToPostTST.a2w (111.5 KB, 15 views)
Reply With Quote