Today, you used a very important computer science concept: if statements. 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 bringan umbrella. If I have a question in CS First, then I’ll put up my sticky note.
If statements are just a type logic that help people make decisions. Computer scientists,just like you, can use If statements to program a computer, or a robot, to “think” andmake decisions. Today, you programmed a sprite to follow amouse pointer through 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 reaches the end of the maze.
This basic idea of programming a robot using if statements has some amazing real-worldapplications. Take a look at another example of how computerscience can be used to help people and to save lives. In this video Sebastian Thrunexplains the self-driving car.
Car accidents are the number one cause of death for young people, and accidents aremostly 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 still many years away from being sold, because, like you, the computerscientists creating it spend a lot of time testing their code and ensuring that the cardrives the way they intend. In the next CS First club, you will continueto use if statements while making a platform game.
Remember to look for ways to use coding in your daily life. Talk to your teachers aboutbuilding a Scratch report on a topic for class.
Until next time-- have fun creating and coding. See ya next time!
"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
"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
"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/)
"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