Your browser version is not supported by this site. CS First may not work properly. Learn more.
7. Wrap-up: Maze Game
Today, you used an important computer science concept.
This game and all other video games,could not be created without them.
But, did you know that you use if statements everyday?
Here are some examples.
If I'm thirsty, then I'll get a drink of water.
If it's raining, then I'll bring an umbrella.
If statements are just the type of logicthat help people make decisions.
Computer scientists just like you, can use if statementsto program a computer,or a robot to think and make decisions.
Today you programmed a sprite to follow a mouse pointerthrough a maze.
But, it's possible to use if statements to program spritesor even cars to go through a maze on their own.
Take a look at an example.
This robot has sensors that allow it to see walls.
If the robot sees a wall, then it turns.
The robot repeats this if statement until it reachesthe end of the maze.
This basic idea of programming a robot using if statements,has some amazing real world applications.
Take a look at another example of how computer sciencecan be used to help people and to save lives.
This video explains a self driving car.
For a vehicle to drive itself,it needs to know where it is in the world.
And it also needs to know what's around it.
Based on these factors, it needs to be able to makesmart and safe driving decisions in the real world.
So think of the sensors as the cars eyes and ears.
But with eyes, it can see far off into the distance,and 360 degrees around the car.
And the great thing about having all of these sensors,is that they can talk to each other, and get crosschecked information about the environment.
So why we've taken a ton of informationusing our sensors.
It's our software that really processes all of thisand differentiates between objects.
All these objects are visible on the laptop that thesafety drivers use while testing the vehicles.
Based on what the vehicle senses and processes,these objects will be representedby different color boxes.
Cyclists will be red, pedestrians yellowand the vehicles will appear as either green or pink.
These boxes demonstrate the processing that takesplace within the software.
And think about the complexity here.
People look different, cars have different shapes and sizes.
Yet despite these nuances, the software needs to classifythese objects appropriately based on factors liketheir shape, movement pattern, or location.
Car accidents are the number one cause of deathfor young people.
And accidents are mostly caused by human error.
Unlike humans, computers can see all around.
Never get distracted and react in an instant to hazards.
Driverless cars and computer scientists can save lives.
The self driving car is stillmany years away from being sold,because like you, the computer scientists creating itspend a lot of time testing their code,ensuring that the car drives in the way they intend.
And the next to Csfirst club, you will continue to useif statements while making a platform game.
Remember to look for ways to use coding in your daily life.
Talk to your teachers about building a scratch reporton a topic for class.
"A Ride in the Google Self Driving Car" by Goog Self-Driving Car Project (https://www.youtube.com/watch?v=TsaES--OTzM) -- Licensed by Creative Commons Attribution 3.0 Unported (https://creativecommons.org/licenses/by/3.0/legalcode) -- Video trimmed to needed length
"Google's Lexus RX 450h Self-Driving Car" by Steve Jurvetson (https://commons.wikimedia.org/wiki/File:Google%27s_Lexus_RX_450h_Self-Driving_Car.jpg) -- Licensed by Creative Commons 2.0 Generic (https://creativecommons.org/licenses/by/2.0/) -- No modifications made
"mBot Solving a Maze" by Charles McKnight (https://www.youtube.com/watch?v=yx6JtQVpcUw) -- Licensed by Creative Commons Attribution 3.0 Unported (https://creativecommons.org/licenses/by/3.0/legalcode) -- Video trimmed to needed length | Blocks overlayed on top
"Nervous System Project (School)" by mewwkitty (https://scratch.mit.edu/projects/18652496/) -- Licensed under CC BY-SA 2.0 (https://creativecommons.org/licenses/by-sa/2.0/)
"Japanese car accident" by Shuets Udono (https://commons.wikimedia.org/wiki/File:Japanese_car_accident_blur.jpg) -- Licensed under CC BY-SA 2.0 (https://creativecommons.org/licenses/by-sa/2.0/) -- No modifications made