Today, we're going to learn how to tell our robots when it's time to play and when it's time to rest, using some simple coding rules called conditional statements. Think of it as teaching our robot to choose what to do just like you do every day!
In this episode, we program our robot with two basic instructions:
IF - This is the rule for the daytime. Terysa codes her robot to think: IF it's daytime and sunny outside, then go out and play. It’s like when you look out the window in the morning and see the sun, you know it’s time to grab your toys and have some outdoor fun!
ELSE - This rule is for when it's not daytime. Terysa tells her robot: ELSE (which means if it's not sunny and bright), it’s time to sleep. Just like when the night comes, and you know it’s time to tuck into bed and dream sweetly until morning.
Watch how Terysa’s robot uses these rules to make decisions. When the sun is up, the robot enjoys playing outside, and when the stars come out, it knows it’s time to rest and recharge.
Want to see how it all works? Click on our video to see Terysa's robot follow these day and night rules. Coding isn't just about computers—it's about helping us make decisions and learning new things!
Don’t forget to like, share, and subscribe for more fun coding adventures with Terysa. Dive into coding and discover how it can add fun to your day and rest to your nights! Happy coding, everyone!
Comments