Main content

Creating a simple automated driving simulator
Computer programs often contain simulations of the real world or an imagined world. At a simple level, the MIT programming toolkit Scratch is used to simulate a car travelling around a track. The track is drawn on screen using a computer paint tools. The car is represented as a sprite, a controllable graphic object. Repetition is used in the program to move the car sprite, with if/then statements steering the car back on if it starts to leave the track. There is a variable determining the car鈥檚 speed. Testing the program shows that it doesn鈥檛 work for high speeds on complex tracks, and some further debugging is needed.
Duration:
This clip is from
More clips from Cracking the Code
-
How pictures can be represented in the form of binary digits
Duration: 04:33