Learning Objectives
Video LessonsReference
Testing for UnderstandingRelated LinksLogo How-TosLogo in your browserLogo SoftwareLogo OrganizationsLogo ForumsThe work on this shelf is powered by you andMicroWorlds Web Player is officially supported under Internet Explorer or Netscape 4 or higher |
repeat, if and ifelseReviewBy now, you've used at least a couple of commands that like instruction lists as input, like everyone and forever. For example, you might have used something like: forever [fd 5 wait 1] You know that an instruction is a command together with its inputs (if any), and an instruction list is a list of instructions. For example, the instruction list [seth 0 clickon] has two instructions: seth 0 and clickon. In the Procedures Tab, Returns are treated as spaces, so you can write procedures like this: to start In the Command Center, you can't have lists that start on one line and end on another, but in procedures it's OK. You could also write something like this: to go RepeatThere is another useful command that likes an instruction list as one of its inputs. The repeat command need two inputs. For the first input, repeat likes a number. For the second input, repeat likes an instruction list. The repeat command repeat 4 [fd 50 rt 90] runs the instructions in the instruction list [fd 50 rt 90] four times. IfLike the repeat command, the if command also needs two inputs and likes an instruction list as its second input. For its first input, it likes "true or "false. If the first input is "true, if runs the instruction list. If the first input is "false, it doesn't run the instruction list. IfelseThe ifelse command needs three inputs. Like if, it likes "true or "false as its first input. It likes an instruction list for the second input and an instruction list for the third input. Like if, if the first input is "true, ifelse runs the instruction list given as the second input. If the first input is "false, ifelse runs the instruction list given as the third input. About the Center for Talent DevelopmentCenter for Talent Development (CTD), housed at Northwestern University's School of Education and Social Policy, is an accredited learning center and research facility that identifies, educates and supports gifted students and their families and serves as a leader in gifted education. Learn more about the Center for Talent Development. |
Leone Learning Systems, Inc. (LLS) is a North Shore company that provides online courses for kids anywhere and local teaching and tutoring services for students in Chicago and the Northern Suburbs of Chicagoland. LLS also provides a free geometry software package for children age 6 and up, and free resources for teachers and parents. This site includes information about classes taught, availability for tutoring, learning activities for kids, lesson plans, and ongoing software and curriculum research and development efforts. |
|