-
Notifications
You must be signed in to change notification settings - Fork 66
Tutorial updates, + new loops tutorial #2622
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
xsebek
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, I like the loops tutorial. 👍
| - | | ||
| Some kind of `while`{=snippet} loop would obviously come in | ||
| handy here. However, the Swarm language does not have loops, | ||
| only recursion, which is enabled by the `strange loop`{=entity} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed that the strange loop is not installed if you write the while definition outside the build command. Is it worth calling out strange loop, if its description is mysterious and does not add anything?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed that the strange loop is not installed if you write the
whiledefinition outside thebuildcommand.
Oh, hmm, really? I would say that is a bug. (Filed #2627.)
I called out strange loop because later when the player starts the classic mode game, they will want to know that they need to craft one in order to be able to use recursive functions. Of course they can also discover this through the error message that happens when they try to run a recursive function without one; but IMO it's better if their reaction at that point is "oh, right, I remember that. I wonder how I can craft one?" rather than "wait, what's a strange loop?". But I could be convinced otherwise.
world101(world101 does not require conditionals)farming, which prompts you to implement a while loop using recursion.