18 08 29 cue code solutions - api.makewonder.com · 1. move 1.1 - get moving write some code to get...

60
1. Move 1.1 - Get Moving Write some code to get your robot ready for the races! Can you help your robot go forward 25cm? Starting Program: Hint: Tap the blue Actions drawer and try dragging the move block into the on start block. Recommended Solution: Alternatives: - Any other speed - Any number of move blocks that add up to 25cm 1.2 - More or Less Now try editing a block. Tap the numbers in the move block to change distance or speed. Can you help your robot racer move forward 50cm? Starting Program:

Upload: others

Post on 27-Sep-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 18 08 29 cue Code Solutions - api.makewonder.com · 1. Move 1.1 - Get Moving Write some code to get your robot ready for the races! Can you help your robot go forward 25cm? Starting

1. Move

1.1 - Get Moving

Write some code to get your robot ready for the races!

Can you help your robot go forward 25cm? Starting Program:

— Hint: Tap the blue Actions drawer and try dragging the move block into the on start block.

Recommended Solution:

Alternatives:

- Any other speed - Any number of move blocks that add up to 25cm

1.2 - More or Less

Now try editing a block. Tap the numbers in the move block to change distance or speed.

Can you help your robot racer move forward 50cm? Starting Program:

Page 2: 18 08 29 cue Code Solutions - api.makewonder.com · 1. Move 1.1 - Get Moving Write some code to get your robot ready for the races! Can you help your robot go forward 25cm? Starting

Hint: We already have a move block to work with. Tap the number for distance to change it.

Recommended Solution:

Alternatives:

- Any other speed - Any number of move blocks that add up to 50cm

1.3 - Never Look Back

You can delete a block if you don’t want it in your program anymore. Can you remove a block so your robot racer doesn’t turn its head anymore? Starting Program:

Page 3: 18 08 29 cue Code Solutions - api.makewonder.com · 1. Move 1.1 - Get Moving Write some code to get your robot ready for the races! Can you help your robot go forward 25cm? Starting

Hint: Drag the turn head block out of the program and drop it into the trash can on the left. Recommended Solution:

Alternatives:

● Any other speed ● Any number of move blocks that add up to 75cm

1.4 - Wait, Come Back

Connect more blocks inside of on start to send more instructions to your robot racer. Can you add to the end of this program to make your robot racer come back after it waits?

Starting Program:

— Hint: Can you add a second move block with an opposite amount of distance?

Page 4: 18 08 29 cue Code Solutions - api.makewonder.com · 1. Move 1.1 - Get Moving Write some code to get your robot ready for the races! Can you help your robot go forward 25cm? Starting

Recommended Solution:

Alternatives:

1.5 - Intro to Text

You can program your robot with blocks or text. You can also switch back and forth between the two kinds of code. Look at this program. What do you think the robot will do?

Then run the program to see what happens. Starting Program:

Page 5: 18 08 29 cue Code Solutions - api.makewonder.com · 1. Move 1.1 - Get Moving Write some code to get your robot ready for the races! Can you help your robot go forward 25cm? Starting

— Hint: Just press play to watch your robot perform the program. Recommended Solution: The robot turns 90 degrees and moves. This happens three times.

1.6 - Changing Text

The numbers in a move command show distance and speed. The number in a turn command shows degrees. Change the last two lines of code so that your robot will move twice as far and turn twice as much as in the first two lines. Starting program:

— Hint: Double the numbers in the last two lines of code. Recommend Solution:

Note: Doubling the speed is ok.

1.7 - Adding Text

The menu on the left side of the screen helps you find the commands you need. In this

program, your robot spins right and then spins left. Select a setWheelSpeeds command

from the menu so that your robot spins right again.

Page 6: 18 08 29 cue Code Solutions - api.makewonder.com · 1. Move 1.1 - Get Moving Write some code to get your robot ready for the races! Can you help your robot go forward 25cm? Starting

Starting Program:

Hint: Change the numbers in the new setWheelSpeeds command to (40, 0). Recommended Solution:

1.8 - You AutoComplete Me

You can type a period after the word actions to show a menu of commands. Then use arrow keys to select an option and press enter or return. Add a period to end of each line to

add commands that make your robot move forward, turn right, and then move forward again. Starting Program:

Hint: Type actions.turn to select that command.

Recommended Solution:

Page 7: 18 08 29 cue Code Solutions - api.makewonder.com · 1. Move 1.1 - Get Moving Write some code to get your robot ready for the races! Can you help your robot go forward 25cm? Starting

2. Show

2.1 - Show off

Help your robot put on a show by setting all of its lights to off after changing to purple, orange, and yellow.

Starting Program:

Hint: Be sure to change the final set light block.

Recommended Solution:

Page 8: 18 08 29 cue Code Solutions - api.makewonder.com · 1. Move 1.1 - Get Moving Write some code to get your robot ready for the races! Can you help your robot go forward 25cm? Starting

2.2 - Face blast

With the set face block, you can change any of the lights in your robot’s face. Can you turn on all of the face lights and set them to full brightness?

Starting Program:

— Hint: You only need one Action block. Recommended Solution:

Page 9: 18 08 29 cue Code Solutions - api.makewonder.com · 1. Move 1.1 - Get Moving Write some code to get your robot ready for the races! Can you help your robot go forward 25cm? Starting

2.3 - Do blink twice

Start with this program that makes your robot blink once.

Can you add to the program to make your robot blink twice? Starting Program:

— Hint: Turn robot's light on, off and on again to blink once. How can your robot blink twice?

Recommended Solution:

Page 10: 18 08 29 cue Code Solutions - api.makewonder.com · 1. Move 1.1 - Get Moving Write some code to get your robot ready for the races! Can you help your robot go forward 25cm? Starting

2.4 - Color coordinated

Without adding any blocks, use your robot’s buttons to turn its ear and chest lights green. Starting Program:

Page 11: 18 08 29 cue Code Solutions - api.makewonder.com · 1. Move 1.1 - Get Moving Write some code to get your robot ready for the races! Can you help your robot go forward 25cm? Starting

— Hint: You only have to press each button once. Recommended Solution:

Robot inputs (there is a timer so be quick with the button presses!): 1. Circle button down 2. Square button down 3. Circle button up

4. Triangle button down 5. Square button up 6. Triangle button up

2.5 - Sound Off

You can use sound blocks to program what your robot will say. Add blocks to the program so that your robot counts to three using both sounds and face patterns before it animates.

Starting Program:

Page 12: 18 08 29 cue Code Solutions - api.makewonder.com · 1. Move 1.1 - Get Moving Write some code to get your robot ready for the races! Can you help your robot go forward 25cm? Starting

Hint: Add sound blocks that say two and three to the program. Recommended Solution:

2.6 - Sound Check

Your robot wants to try out different expressions and sounds. Add one more sound block to the program that expresses another emotion.

Page 13: 18 08 29 cue Code Solutions - api.makewonder.com · 1. Move 1.1 - Get Moving Write some code to get your robot ready for the races! Can you help your robot go forward 25cm? Starting

Starting Program:

— Hint: Add a sound block and pick a sound from the Expressions menu.

Recommended Solution:

Note: any Expression sound that is a valid answer.

Page 14: 18 08 29 cue Code Solutions - api.makewonder.com · 1. Move 1.1 - Get Moving Write some code to get your robot ready for the races! Can you help your robot go forward 25cm? Starting

2.7 - Custom Recording

You can use custom sound blocks to record your voice and play it back through your

robot’s speaker! Add two more custom sounds blocks to the program and create your own recording for each. What will your robot say before and after it turns? Starting Program:

— Hint: Tap each custom sound block to record different sounds.

Recommended Solution:

Page 15: 18 08 29 cue Code Solutions - api.makewonder.com · 1. Move 1.1 - Get Moving Write some code to get your robot ready for the races! Can you help your robot go forward 25cm? Starting

2.8 - Name That Tune

Your robot can sing a few tunes!

Add a custom sound block to the program to help your robot finish the song! Starting Program:

— Hint: You can find the custom sound blocks near the bottom of the Actions menu

Recommended Solution:

Note: solution should be any custom sound slot (1-10)

Page 16: 18 08 29 cue Code Solutions - api.makewonder.com · 1. Move 1.1 - Get Moving Write some code to get your robot ready for the races! Can you help your robot go forward 25cm? Starting

2.9 - Red, Green, and Blue

You can change the color of your robot’s lights using RGB colors(red,green, and blue). Change the numbers in each actions.rgb command so that the robot lights turn red(255,

0,0),green(0, 255,0), and then blue(0,0,255). Starting Program:

— Hint: Change the numbers in the fourth and sixth lines to show green and blue.

Recommended Solution:

2.10 - Sound of Colors

You can use playSound to help your robot play different sounds in text. Look at the second color that your robot shows in this program. Add a sound to the end of the program so that your robot calls out that color’s name!

Starting Program:

Page 17: 18 08 29 cue Code Solutions - api.makewonder.com · 1. Move 1.1 - Get Moving Write some code to get your robot ready for the races! Can you help your robot go forward 25cm? Starting

— Hint: Your robot shows blue at the end of the program. Add a Snippets_Blue sound to the end of the program.

Recommended Solution:

2.11 - Binary Lights

In text, you set your robot’s face pattern using 1’s (to turn face lights on) and 0’s (to turn face lights off). Each number matches a different face light. Change the numbers in the face pattern commands so that all of the robot’s face lights turn ON and then turn OFF. Starting Program:

— Hint: All of the numbers within each set of quotation marks should be the same. Recommended Solution:

Page 18: 18 08 29 cue Code Solutions - api.makewonder.com · 1. Move 1.1 - Get Moving Write some code to get your robot ready for the races! Can you help your robot go forward 25cm? Starting

2.12 - Light My Buttons

You can use setButtonLights to turn the robot’s button lights on and off. Set the brightness of a button by typing a number between 0 (light off) and 255 (maximum brightness). Add a command to the program to turn the robot’s Main button light on. Starting Program:

Hint: Set the Main button’s brightness by selecting a number between 1–255. Recommended Solution:

3. Sense

3.1 - Step away

Use the when obstacle block to start a program as soon as the robot detects something with an obstacle sensor.

Can you change the program so the robot moves backward when it senses something in front of it? Starting Program:

Page 19: 18 08 29 cue Code Solutions - api.makewonder.com · 1. Move 1.1 - Get Moving Write some code to get your robot ready for the races! Can you help your robot go forward 25cm? Starting

— Hint: Keep the blocks you started with but make a change.

Recommended Solution:

Robot Inputs

1. Trigger front obstacle seen

3.2 - Round of Applause

Different kinds of events, like obstacles seen and buttons pressed, have different when

blocks. Can you program the robot to spin in a full circle when you clap?

Starting Program:

— Hint: Which “when” block will you need so that the robot turns when you clap?

Page 20: 18 08 29 cue Code Solutions - api.makewonder.com · 1. Move 1.1 - Get Moving Write some code to get your robot ready for the races! Can you help your robot go forward 25cm? Starting

Recommended Solution:

Robot Inputs

1. Trigger clap heard

3.3 - Pressing matters

A wait until block can be used to pause a program until your robot senses something, like a button press. Can you program your robot to move forward only after all four buttons have been

pressed? Starting Program:

— Hint: You’ll need a wait until block for each of the buttons on your robot’s head. Recommended Solution:

Page 21: 18 08 29 cue Code Solutions - api.makewonder.com · 1. Move 1.1 - Get Moving Write some code to get your robot ready for the races! Can you help your robot go forward 25cm? Starting

Robot Inputs:

1. All four buttons in the order they are written in the user-written program

Alternatives: Any permutation of all four wait until button down blocks prior to a move block with a distance greater than or equal to 1 cm.

3.4 - Two-faced

When you use a while block, you can give instructions that repeat until your robot senses something in particular. Try out the code! How can you help your robot try on each mask twice?

Starting Program:

Page 22: 18 08 29 cue Code Solutions - api.makewonder.com · 1. Move 1.1 - Get Moving Write some code to get your robot ready for the races! Can you help your robot go forward 25cm? Starting

____ Hint: Make sure you hold the button until the face pattern changes enough times. Recommended Solution:

Robot Inputs 1. Hold main button until two face patterns appear twice.

3.5 - Events in text

When you type “events.” in text, you see a menu of different events that your robot can detect. In this program, your robot laughs when you pick it up. Change the program so that

your robot laughs and shows red lights when you pick it up. Starting Program:

__

Hint: Replace Colors.Blue with Colors.Red.

Page 23: 18 08 29 cue Code Solutions - api.makewonder.com · 1. Move 1.1 - Get Moving Write some code to get your robot ready for the races! Can you help your robot go forward 25cm? Starting

Recommended Solution:

3.6 - Adding Events

You can use multiple events in the same program.

Add another events.whenButton command to the program. Then change the second event

so that the robot turns blue when its square button is pressed.

Starting Program:

___

Hint: Type a period after Buttons to see your menu of options.

Recommended Solution:

Robot Inputs: 1. Press the square button

Page 24: 18 08 29 cue Code Solutions - api.makewonder.com · 1. Move 1.1 - Get Moving Write some code to get your robot ready for the races! Can you help your robot go forward 25cm? Starting

4. Repeat

4.1 - Eager

Any blocks that you put inside of a repeat block will be read multiple times.

Can you make your robot nod its head in agreement three times? Starting Program:

Hint: Any sequence of instructions that you want your robot to repeat should go inside the

repeat block. Recommended Solution:

Page 25: 18 08 29 cue Code Solutions - api.makewonder.com · 1. Move 1.1 - Get Moving Write some code to get your robot ready for the races! Can you help your robot go forward 25cm? Starting

4.2 - Thorough Search

You can use multiple repeat blocks to control how many times different parts of your program take place. Can you add repeat blocks to this program to make your robot search the perimeter by

looking all the way around both above and below itself? Starting Program:

— Hint: The robot needs to do four turns in each direction. Recommended Solution:

Page 26: 18 08 29 cue Code Solutions - api.makewonder.com · 1. Move 1.1 - Get Moving Write some code to get your robot ready for the races! Can you help your robot go forward 25cm? Starting

4.3 - No Detours

Repeat blocks can go inside of other repeat blocks. Without changing the action blocks, can you use the repeat blocks in this program to make

the robot secure the perimeter by going a total of 50cm in one direction? Starting Program:

— Hint: Change the number inside one of the repeat blocks. Recommended Solution:

Page 27: 18 08 29 cue Code Solutions - api.makewonder.com · 1. Move 1.1 - Get Moving Write some code to get your robot ready for the races! Can you help your robot go forward 25cm? Starting

4.4 - Secure the Perimeter

A not block can change an instruction to its opposite. For example, front obstacle seen becomes not front obstacle seen. Can you make the robot increase the secure zone by zigzagging left, then right) exactly two

times? Starting Program:

Hint: Try removing a block before you run the program. Recommended Solution:

Robot Inputs

1. Allow program of four action blocks to be executed twice. 2. [Optional] Trigger the front sensor

Page 28: 18 08 29 cue Code Solutions - api.makewonder.com · 1. Move 1.1 - Get Moving Write some code to get your robot ready for the races! Can you help your robot go forward 25cm? Starting

4.5 Loops in Text

Loops may look a little complicated in text, but don’t worry! Just focus on the index. The index shows how many times the actions in the loop will repeat. Right now, the program repeats two times. Change the program so that it repeats four times. Starting Program:

Hint: Replace the number 2 in the program with 4. Recommended solution:

Page 29: 18 08 29 cue Code Solutions - api.makewonder.com · 1. Move 1.1 - Get Moving Write some code to get your robot ready for the races! Can you help your robot go forward 25cm? Starting

4.6 Iterator

You can use the index inside a loop to slowly increase the settings of lights, movements, and more! Change the button’s brightness to (index * 60) and see what happens to the button light during the loop. Starting Program:

____

Hint: Replace the number 255 with (index * 60). Recommended Solution:

5. Remember

5.1 - Face lights

You can make a function to remember and reuse code you’ve written. Check out the functions in this program for face animations.

Can you finish the program so your robot’s face will rotate back and forth? Starting Program:

Page 30: 18 08 29 cue Code Solutions - api.makewonder.com · 1. Move 1.1 - Get Moving Write some code to get your robot ready for the races! Can you help your robot go forward 25cm? Starting

— Hint: The only blocks that you need inside of on start are call function blocks. Recommended Solution:

5.2 - Button game

You can use a variable to remember a number and change it at any time. Look at how currentHeadAngle is used here.

Without changing the program, can you use the least number of button presses to turn your robot’s head all the way to 130 degrees?

Starting Program:

Page 31: 18 08 29 cue Code Solutions - api.makewonder.com · 1. Move 1.1 - Get Moving Write some code to get your robot ready for the races! Can you help your robot go forward 25cm? Starting

— Hint:

● Which button moves the robot’s head the furthest? ● (if the triangle button is pressed less than 10 times) How many times do you need to

press the triangle button to get to 130 degrees?

Recommended Solution: Robot Inputs

1. Tap triangle button 10 times.

Page 32: 18 08 29 cue Code Solutions - api.makewonder.com · 1. Move 1.1 - Get Moving Write some code to get your robot ready for the races! Can you help your robot go forward 25cm? Starting

(Leave program unchanged)

5.3 - Hold it down

You can use math blocks to add to, subtract from, multiply, or divide variables. This program uses a multiple of the seconds variable to control how far your robot will move.

Can you make your robot race forward 40cm with a single button press? Starting Program:

Hint: Try looking at the face brightness to gauge how long to hold the button. Recommended Solution:

Robot input 1. Hold the main button for 4 seconds (use the program highlighting to count how

many seconds)

(Leave program unchanged)

5.4 - Wind-up Robot

In this program, the variable winds is used to remember how many times your robot “winds

up” with the main button.

Page 33: 18 08 29 cue Code Solutions - api.makewonder.com · 1. Move 1.1 - Get Moving Write some code to get your robot ready for the races! Can you help your robot go forward 25cm? Starting

Can you fix the unwind function so that the robot unwinds all the way when you press the circle button once? Test your program with four winds.

Starting Program:

— Hint:

● Your unwinding robot needs to turn -90 degrees for every wind.

● Look at the unwind function. You need to add something to the repeat block. ● Use the main button to wind up the robot. ● Did you wind 4 times?

Recommended Solution:

Robot Inputs

1. Press main button four times (observe total of 360 degree turn) 2. Press circle button four times (observe total of -360 degree turn)

Page 34: 18 08 29 cue Code Solutions - api.makewonder.com · 1. Move 1.1 - Get Moving Write some code to get your robot ready for the races! Can you help your robot go forward 25cm? Starting

5.5 - Shapeshifter

You can call functions to reuse code that has already been written. For example, square() calls the square function and makes your robot move in a square. Add one more triangle function call to finish the pattern. Starting Program:

___

Page 35: 18 08 29 cue Code Solutions - api.makewonder.com · 1. Move 1.1 - Get Moving Write some code to get your robot ready for the races! Can you help your robot go forward 25cm? Starting

Hint: Add a line of code that says “triangle()” on line 5. Recommended Solution:

5.6 - Bigger and Better

One variable can be used by multiple functions. Notice that your robot draws shapes with

sides a length of Length. Try changing the Length variable so that your robot draws shapes with a Length of 40. Starting Program:

Page 36: 18 08 29 cue Code Solutions - api.makewonder.com · 1. Move 1.1 - Get Moving Write some code to get your robot ready for the races! Can you help your robot go forward 25cm? Starting

___ Hint: Change the number in line 2 to the number 40.

Recommended solution:

Page 37: 18 08 29 cue Code Solutions - api.makewonder.com · 1. Move 1.1 - Get Moving Write some code to get your robot ready for the races! Can you help your robot go forward 25cm? Starting

5.7 - The Blues

Variables can be used to keep track of things while the program is running. In this program, the Blue variable keeps track of how much blue we add to the lights. Without changing the

program itself, can you use the robot’s buttons to change the lights from red to blue? Starting Program:

___

Hint: Which button increases the amount of blue in the lights? Recommended Solution:

Robot Inputs: 1. Press the triangle button at least five times

(Leave program unchanged)

5.8 - spinBot

You can use local variables in functions to customize the function each time you call it!

Page 38: 18 08 29 cue Code Solutions - api.makewonder.com · 1. Move 1.1 - Get Moving Write some code to get your robot ready for the races! Can you help your robot go forward 25cm? Starting

In this program, spinSpeed sets the speed of the spin and numColors sets the number of

colors in the dance. Change line 5 by doubling both the spinSpeed and the numColors

variables. Starting Program:

___

Hint: Change the second function call to “spinDance(80, 4)”.

Recommended Solution:

Page 39: 18 08 29 cue Code Solutions - api.makewonder.com · 1. Move 1.1 - Get Moving Write some code to get your robot ready for the races! Can you help your robot go forward 25cm? Starting

6. Decide

6.1 - Back and forth

You can use an if-else block to check if an event is true or false. The top section will play if the event is true and the bottom section will play if the event is not true. Without changing the program, can you make your robot move back and forth twice?

Starting Program:

Page 40: 18 08 29 cue Code Solutions - api.makewonder.com · 1. Move 1.1 - Get Moving Write some code to get your robot ready for the races! Can you help your robot go forward 25cm? Starting

– Hint: Your robot will move backward if it detects an obstacle in the front. Recommended Solution:

Robot Input: 1. Let the robot move forward 2. Put your hand in front of the robot (wait for the robot to move back) 3. Let the robot move forward

4. Put your hand in front of the robot (wait for the robot to move back) (Leave the program unchanged)

6.2 - Costume change

This program uses an and block to check for two things at once and an or block to check for at least one of two things. Can you use this program to give your robot a costume change by changing its lights to

blue and then purple? Starting Program:

Page 41: 18 08 29 cue Code Solutions - api.makewonder.com · 1. Move 1.1 - Get Moving Write some code to get your robot ready for the races! Can you help your robot go forward 25cm? Starting

Hint: Once your program starts, there are four things you need to do. Recommended Solution:

Robot Inputs

1. Trigger front and back sensors 2. Press and hold either option 1: main button + circle button or option 2: main button

+ square button

6.3 - Magic number

You can use an is equal to (=) block to check whether two numbers are the same. Can you make your robot spin when the variable hits the magic number (without changing

the program)? Starting Program:

Page 42: 18 08 29 cue Code Solutions - api.makewonder.com · 1. Move 1.1 - Get Moving Write some code to get your robot ready for the races! Can you help your robot go forward 25cm? Starting

– Hint: How can you change the variable just the right amount. Recommended Solution:

Robot Input

1. Trigger front obstacle seen x5

Page 43: 18 08 29 cue Code Solutions - api.makewonder.com · 1. Move 1.1 - Get Moving Write some code to get your robot ready for the races! Can you help your robot go forward 25cm? Starting

2. Press main button down and then up

(Leave the program unchanged)

6.4 - Are we there yet?

In this program, your robot will move in a square pattern as you press a button.

Can you change the if block comparisons so that your robot fills its face pattern based on how much of the square motion it has moved through? Starting Program:

Page 44: 18 08 29 cue Code Solutions - api.makewonder.com · 1. Move 1.1 - Get Moving Write some code to get your robot ready for the races! Can you help your robot go forward 25cm? Starting

__ Hint: What number should turnsCompleted be when the square is complete? Recommended Solution:

Robot Inputs

1. Press square button x4

Page 45: 18 08 29 cue Code Solutions - api.makewonder.com · 1. Move 1.1 - Get Moving Write some code to get your robot ready for the races! Can you help your robot go forward 25cm? Starting

6.5 - Scaredy Bot

In text, we use if/else for conditionals and the events that are checked are placed in

(parentheses). Without changing the program, use your robot’s sensors to make it first act bored and then act scared.

Starting Program:

Hint:

● Your robot acts bored when it doesn’t detect an obstacle with the front sensors.

● If your robot detects an obstacle with the front sensors, it will act scared. Recommended Solution:

Robot Input: 1. Wait for the robot to act bored 2. Put an obstacle in front of the robot

(Leave the program unchanged)

Page 46: 18 08 29 cue Code Solutions - api.makewonder.com · 1. Move 1.1 - Get Moving Write some code to get your robot ready for the races! Can you help your robot go forward 25cm? Starting

6.6: On and Off

Conditionals can also check for booleans. Booleans help you keep track of whether something is true or false.

In this program, the buttonOn variable is set to false. Without changing the program, how can you set the the buttonOn variable to true?

Starting Program:

Hint: You will need to press one of the robot’s buttons. Recommended Solution:

Robot Input: 1. Press the main button

(Leave the program unchanged)

6.7: Turn It Up

Conditionals can check for variable values too.

Page 47: 18 08 29 cue Code Solutions - api.makewonder.com · 1. Move 1.1 - Get Moving Write some code to get your robot ready for the races! Can you help your robot go forward 25cm? Starting

Change the conditional so that the robot plays an animation after you press the main

button at least 3 times.

Starting Program:

___

Hint: Change line 8 so that the conditional checks for at least 3 buttonPresses.

Recommended Solution:

Robot Input: Press the main button 3 times.

Page 48: 18 08 29 cue Code Solutions - api.makewonder.com · 1. Move 1.1 - Get Moving Write some code to get your robot ready for the races! Can you help your robot go forward 25cm? Starting

6.8: Danger!

The “&&” in text is like the and block. It checks if both conditions are true. The “||” in text is like the or block. It checks if at least one of the conditions is true. Without changing the program, can you first make your robot act scared and then act alarmed? Starting Program:

__

Page 49: 18 08 29 cue Code Solutions - api.makewonder.com · 1. Move 1.1 - Get Moving Write some code to get your robot ready for the races! Can you help your robot go forward 25cm? Starting

Hint: ● If your robot sees an obstacle in front or behind it, then it acts scared.

● If your robot sees an obstacle in front and behind it, then it acts alarmed. Recommended Solution:

1. Put an obstacle in front or behind your robot

2. Put an obstacle in front of your robot, and another one behind it (Leave the program unchanged)

7. Store

7.1: Colorful

Arrays are like variables, but can remember more than one thing. Run the program. Then press the main button to cycle through all the different colors in

the “ColorList” array. Starting Program:

Page 50: 18 08 29 cue Code Solutions - api.makewonder.com · 1. Move 1.1 - Get Moving Write some code to get your robot ready for the races! Can you help your robot go forward 25cm? Starting

Hint : Keep pressing the main button until your robot has changed colors three times.

Recommended Solution: Press the Main Button three times. 7.2: More Colors, Please

Add the color orange (Colors.Orange) to the end of the “ColorList” array. Then press the main button to cycle through all the different colors. Starting Program:

Hint:

● Press the main button four times.

● Add a comma and Colors.Orange to the list of colors on line 2.

Recommended Solution:

Page 51: 18 08 29 cue Code Solutions - api.makewonder.com · 1. Move 1.1 - Get Moving Write some code to get your robot ready for the races! Can you help your robot go forward 25cm? Starting

Robot Input: Press the main button four times times

7.3: Color Change

Create your own ColorList with three different colors. Then press the main button to cycle through all the different colors. Starting Program:

Page 52: 18 08 29 cue Code Solutions - api.makewonder.com · 1. Move 1.1 - Get Moving Write some code to get your robot ready for the races! Can you help your robot go forward 25cm? Starting

___

Hint:

● Press the main button three times. ● Add three colors inside the [ ] in line 2. Make sure you add a comma after each color! ● Add two more colors to ColorList. ● Add one more color to ColorList.

Recommend Solution:

Robot Input: Press the main button three times

Page 53: 18 08 29 cue Code Solutions - api.makewonder.com · 1. Move 1.1 - Get Moving Write some code to get your robot ready for the races! Can you help your robot go forward 25cm? Starting

(Leave the rest of the program unchanged)

7.4: Color Code

Each item in an array is assigned a number, starting with 0. For example, you can get the first color in “TheColors” by using TheColors[0].

Without changing the program, use three button presses to show the colors from first to last.

Page 54: 18 08 29 cue Code Solutions - api.makewonder.com · 1. Move 1.1 - Get Moving Write some code to get your robot ready for the races! Can you help your robot go forward 25cm? Starting

Starting Program:

___ Hint:

● Press the triangle button first. ● ColorList[1] is the second color in the list. ● ColorList[2] is the last color in the list.

Page 55: 18 08 29 cue Code Solutions - api.makewonder.com · 1. Move 1.1 - Get Moving Write some code to get your robot ready for the races! Can you help your robot go forward 25cm? Starting

● Use only three button presses. Recommended Solution:

Robot Inputs: 1) Press the triangle button 2) Press the circle button

3) Press the square button (Leave the program unchanged)

8. Transform

8.1: Light Magic

In this program, button presses will change the array and show different numbers of

lights.

Without changing the program, use the main and triangle button to show three face lights, one face light, and then five face lights. Starting Program:

Page 56: 18 08 29 cue Code Solutions - api.makewonder.com · 1. Move 1.1 - Get Moving Write some code to get your robot ready for the races! Can you help your robot go forward 25cm? Starting

___

Hint: ● The main button turns on lights ● The triangle button turns off lights.

Recommended Solution:

Robot Inputs: 1. Main button three times 2. Triangle button two times

3. Main button four times

(Leave program unchanged)

8.2: Button Shift

Change the program so that the number of lights increase and decrease using the square and circle buttons instead.

Run your program and have your robot show three and then two lights. Starting Program:

Page 57: 18 08 29 cue Code Solutions - api.makewonder.com · 1. Move 1.1 - Get Moving Write some code to get your robot ready for the races! Can you help your robot go forward 25cm? Starting

___ Hints:

● Copy all 3 lines of code in the main button event and put it in the square button event.

● Copy all 3 lines of triangle button event and put it in the circle button event. Recommended Solution:

(Change the events only)

Page 58: 18 08 29 cue Code Solutions - api.makewonder.com · 1. Move 1.1 - Get Moving Write some code to get your robot ready for the races! Can you help your robot go forward 25cm? Starting

Robot Inputs:

1. Press the new user assigned button for increasing number of lights three times 2. Press the new user assigned button for decreasing number of lights once.

8.3: Color Cycle

You can use the index inside a loop to cycle through all the colors in your array.

Right now, the loop only plays the first color. Replace the number 0 in the loop with the word index to cycle through all the colors.

Hint: Change the number “0” in line 10 to index Starting Program:

___

Recommended Solution:

Page 59: 18 08 29 cue Code Solutions - api.makewonder.com · 1. Move 1.1 - Get Moving Write some code to get your robot ready for the races! Can you help your robot go forward 25cm? Starting

8.4: Rainbow

Functions can take in arrays as a parameter.

Call the spinDance function one more time using the rainbowList array.

Starting Program:

Hint:

● Add a spinDance() call to line 7. What array should you put in the parentheses?

Page 60: 18 08 29 cue Code Solutions - api.makewonder.com · 1. Move 1.1 - Get Moving Write some code to get your robot ready for the races! Can you help your robot go forward 25cm? Starting

● Keep the line that calls spinDance(shortList) in line 5.

Recommended Solution: