Coding Adventure 5: Let's race

What is the function of a snowman?

Learn nested loops, Arrays, Lists and functions to build and play with your snowman

免費加入

描述

It is time of racing between friends on skin kayak. Have the fun and announce the results. 

預覽視頻

任務

Racing time

Now it's racing time. The lane numbers are shown in the white cells (to the right). Results are shown in the red, yellow, and blue cells. Red cells will contain the first level winners lane numbers (1st and 2nd rank), while yellow cells will contain the second level lane number (3rd and 4th rank). Finally, blue cells will contain the lane numbers of the last three positions.

It is required to print on screen the results colors list in order of lanes like in the shown case.

yellow,red,blue,blue,red,blue,yellow

Hint: Print the list of lane colors that contains the 7 colors ordered by lane number

Racing lanes results

Now it is required to print the colors of lanes in results on screen, each lane color in a separate line (separate print) like: yellow, red, blue, blue, red, blue and yellow

Lane result color and lane number

Now it is required to print the colors of lanes in results on screen, each lane color is preceded by the lane number like: 

1,yellow .. 2,red .. 3,blue .. 4,blue .. 5,red .. 6,blue .. 7,yellow

Hint: Each lane color with its number should be printed in a separate line.

Color lane numbers with their ranking color

Now it is time to color white cells on the right that contain racing lane numbers. Each lane number should be colored by its results color (1st and 2nd positions in red, 3rd and 4th positions in yellow, rest positions in blue).

Color lanes and print results

Now it is time to do both coloring the lanes and printing results on screen.

Color white cells on the right that contain racing lane numbers. Each lane number should be colored by its results color (1st and 2nd positions in red, 3rd and 4th positions in yellow, rest positions in blue).

In addition to lane coloring, print the colors of lanes in results on screen, each lane color is preceded by the lane number like: 

1,yellow .. 2,red .. 3,blue .. 4,blue .. 5,red .. 6,blue .. 7,yellow

Hint: Each lane color with its number should be printed on screen in a separate line.

What is the function of a snowman?

Learn nested loops, Arrays, Lists and functions to build and play with your snowman

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