Answers.Body: <p>A conditional can perhaps be represented by a door that can be blocked from the other side, or maybe two doors, of which only one is blocked via a sliding brick.</p>
  
  <p>As for loops, I would represent them as conditionals with counters, by blocking a door with a set number of bricks and removing one brick per iteration. If you'd rather count upwards, then a fixed size hole can be filled with bricks gradually.</p>
  
  <p>These analogies were made to the "minifig walking through a set of corridors - the program" analogy, but we could surely find solutions for axles and gears or even pneumatics if you were thinking along those lines.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-10-22T19:37:51.603Z
Answers.Text: I was thinking more along the lines of "this building is like a script", but your ideas seem to work with that as well.
Answers.UserDisplayName: Scimonster
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-10-31T10:49:20.883Z
Answers.Text: @Scimonster If the answer was useful for you, please consider accepting it, unless there is some information you still wait for, in which case I'll be happy to amend it.
Answers.UserDisplayName: zovits
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-10-31T10:50:29.990Z
Answers.Text: I'm just waiting to verify that this works. I will be holding the class next week, and will try it out then.
Answers.UserDisplayName: Scimonster
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-11-05T15:18:52.777Z
Answers.Text: In the end the kids were able to understand without the LEGOs, but you had a good method anyways. I might use it next time. :)
Answers.UserDisplayName: Scimonster
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-10-22T19:32:52.833Z
Answers.LastActivityDate: 2014-10-22T19:32:52.833Z
Answers.UserDisplayName: zovits
Answers.Body: <p>Based on the image on the Scratch home page, I would simply wrap the substructure in a single color, which represents the loop.</p>
  
  <p>For example:</p>
  
  <pre><code> ______
  |_Loop_|__
  |__|__s1__|
  |__|__s2__|
  |__|__s3__|
  |______|
  </code></pre>
  
  <p>If that makes sense.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-10-22T19:55:03.903Z
Answers.Text: While that indeed works visually, i'm not sure it conveys the message of a loop.
Answers.UserDisplayName: Scimonster
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-10-22T19:52:47.227Z
Answers.LastActivityDate: 2014-10-22T19:52:47.227Z
Answers.UserDisplayName: Nick2253
Body: <p>I understand this may sound like a weird question, but bear with me here, OK?</p>
  
  <p>I'm getting ready to teach some kids introductory computer programming. We're going to use <a href="http://scratch.mit.edu/" rel="nofollow">Scratch</a>, a drag-and-drop "brick-based" language designed by MIT.</p>
  
  <p>Now, scripts in Scratch are comparable to LEGO structures. Each script needs a base, and pieces to build it up. So far, so good.</p>
  
  <p>However, scripts can also contain <strong>conditionals</strong> and <strong>loops</strong>, both of which accept a sub-structure.</p>
  
  <p>I would like to show my students a LEGO structure that is comparable to a Scratch script. How could i do something like conditionals and loops?</p>
  
Tags: <piece-usage>
Title: What kind of design is comparable to these programming concepts?
UserDisplayName: Scimonster
ThreadText: # What kind of design is comparable to these programming concepts?
  
  (Asked by: username_0 on 2014-10-22)
  
  I understand this may sound like a weird question, but bear with me here, OK?
  
  I'm getting ready to teach some kids introductory computer programming. We're going to use [Scratch](http://scratch.mit.edu/), a drag-and-drop "brick-based" language designed by MIT.
  
  Now, scripts in Scratch are comparable to LEGO structures. Each script needs a base, and pieces to build it up. So far, so good.
  
  However, scripts can also contain **conditionals** and **loops**, both of which accept a sub-structure.
  
  I would like to show my students a LEGO structure that is comparable to a Scratch script. How could i do something like conditionals and loops?
  
  **Tags:** piece-usage
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2014-10-22. Score: 2 | Accepted answer
  
  A conditional can perhaps be represented by a door that can be blocked from the other side, or maybe two doors, of which only one is blocked via a sliding brick.
  
  As for loops, I would represent them as conditionals with counters, by blocking a door with a set number of bricks and removing one brick per iteration. If you'd rather count upwards, then a fixed size hole can be filled with bricks gradually.
  
  These analogies were made to the "minifig walking through a set of corridors - the program" analogy, but we could surely find solutions for axles and gears or even pneumatics if you were thinking along those lines.
  
  > **Comments:**
  > **username_0**: I was thinking more along the lines of "this building is like a script", but your ideas seem to work with that as well.  
  > **username_1**: @Scimonster If the answer was useful for you, please consider accepting it, unless there is some information you still wait for, in which case I'll be happy to amend it.  
  > **username_0**: I'm just waiting to verify that this works. I will be holding the class next week, and will try it out then.  
  > **username_0**: In the end the kids were able to understand without the LEGOs, but you had a good method anyways. I might use it next time. :)  
  
  ---
  
  ### Answer by username_2 on 2014-10-22. Score: 1
  
  Based on the image on the Scratch home page, I would simply wrap the substructure in a single color, which represents the loop.
  For example:
   ______
  |_Loop_|__
  |__|__s1__|
  |__|__s2__|
  |__|__s3__|
  |______|
  
  If that makes sense.
  
  > **Comments:**
  > **username_0**: While that indeed works visually, i'm not sure it conveys the message of a loop.  
  
  ---
  
  