Level 6: SCRIPTING CONTROL FLOW
11/13/19 - Nested For Loop
- Reopen L6 Practice scene; then create a new C# script (called NestedForLoop) in your Scripts folder
- Watch "Nested For" (video shown below)
Assignment:
- After you finish watching the above tutorial, resave your L6Practice scene.
- Reopen your L6Assignment scene
- Create a new C# script (called MyLoveFor) in your Scripts folder.
- On Enable, the user will be able to publicly enter (1) a tangible item that they love (in a plural form) and (2) a random number (see Illustration 1 for how it would look in your Inspector Window). A ForLoop will be created with "i" starting at 2 and "i" being less than or equal to the random number chosen above. "i" will increase by one until the condition is met. A statement will continuously print in the Console window with "I love _____ _________" (with the first blank spot being "i" and the second spot being the tangible item). Then when the last statement is printed in the Console Window, another statement will print stating "That's all the __________ that I love! Goodbye Now!" (we haven't talked about where this statement would go; think about it; I'll give you a hint: it goes in another set of curly brackets that you already have in your coding). See Illustration 2.