7. Case 04: Run at Random¶
Make your Cutebot move(move forward, reverse or change direction) as if in “his” mind.
Click the “Advanced” to see more choices in the MakeCode drawer.
Choose “show icon” in the
foreverbrick to set a speed at random from
100of the two wheels.
Assign the two variables of the speed to the left and right wheels.
A codebase is required for Cutebot programming, click “Add Package” at the bottom of the drawer, search
Cutebotin the dialogue box and download it.
Note: If you met a tip indicating incompatibility of the codebase, you can continue with the tips or build a new project there.
小车随机前进，后退或者转向。 The Cutebot moves forward, reverses or changes its direction at random.