Figure 1. A possible use of the AND logic in Scratch. AND logic table is shown. Both A AND B must be true for the combined statement to be true and the block within the If statement run. |
This blog is designed to promote mechatronics (often associated with robotics) to kids. My target age is 8 and up. The idea is to cover basic programming, electronics and 3D design/modeling required for kids to learn about and build simple (low cost) robots.
Tuesday, 11 August 2015
Week 8 (4 Aug)
This week we discussed logic statements in Scratch and in particular AND lofic. This is illustrated in Figure 1.
We can use this kind of logic to determine if two events are true. I asked the students this week to try to use an AND statement in their code. An example application might be an game where you need to find specific items to completed specific tasks. These items can be collected by a player and these items are sometimes called pick-ups. This is particularly important when creating role-playing games (RPG). For example, see the list shown in Figure 2a.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment