I want to randomly position a car across three distinct locations: a garage, a road, and a rail.
To implement this, I created a state variable called carState and assigned it a random integer value between 0 and 2. Where 0 is a garage, 1 is a road, and 2 is a rail.
Then, I used conditional statements (if / else if) so that if the value is 0, the car moves to the garage; if it’s 1, it moves to the road; and if it’s 2, it moves to the rail.
How should I properly program this logic with CoBlocks? https://edu.delightex.com/QVH-NAN