Alexa Metrics

Coding Adventure 8: Fishing automation

Need a break, build a snowman

Use advanced loops in your journey on ice with the snowman

免費加入

描述

This has been amazing! I can't believe we have reached our last adventure of this Journey! Now we need to make our code less and reusable, let's make some functions.

預覽視頻

任務

Let's collect the fish

Robo will pick up the fish and drop it in the bucket.

Now, do that twice

Robo will be asked to do the previous mission twice. He will have to pick up the silver fish and drop it in the yellow bucket. Then, Robo will grab the red fish and drop it in the red bucket.

What about automation?

Robo will create a function that takes an object from the red cell and puts it on the blue cell (3 steps away from the red cell). Then he calls this function to pick and place 3 items.

Now, add a new feature

Robo will modify the function to check the color of the cell and then decide. If the cell color is blue, drop the item after 3 steps, else, collect it and do not drop it.

More modifications

Robo needs to make a function to move and collect items, and then drop them after 3 steps or 2 steps. The function should take an input indicating number of steps. Use this function to make Robo pick up items from red cells and drop them in cells marked in blue.

Need a break, build a snowman

Use advanced loops in your journey on ice with the snowman

免費加入
Canada Flag 隱私政策使 使用條款
Got an invite