From c27147982852387915afd2428624ae4858fcb90e Mon Sep 17 00:00:00 2001 From: Aarav Joshi Date: Thu, 12 Nov 2026 23:24:29 -0500 Subject: [PATCH] Added Bowling Alley Analogy for Coroutine --- .../learning-course/stage1/stage1b/the-command-body.mdx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/content/docs/learning-course/stage1/stage1b/the-command-body.mdx b/src/content/docs/learning-course/stage1/stage1b/the-command-body.mdx index 22b178e9..8cfc1bcf 100644 --- a/src/content/docs/learning-course/stage1/stage1b/the-command-body.mdx +++ b/src/content/docs/learning-course/stage1/stage1b/the-command-body.mdx @@ -46,10 +46,12 @@ programming structures: while loops, variables, method calls, and more. ### The Meaning of `coroutine.yield();` -`coroutine.yield()` is a special statement that must be called inside of while loops. +`coroutine.yield()` is a special statement that must be called inside of while loops that are inside of a command. + It allows for commands to run in parallel, while ensuring that background tasks (like motor safety checks) are run. -An analogy would be the sips of water you take while you finish your homework. + +An analogy would be taking turns in a bowling alley, where players (commands) take turns one at a time to bowl the ball (run the command) for each mechanism, and each mechanism is its own lane. The `coroutine` object contains many other useful methods that can only be called inside of commands.