Programming Concepts 2 - Marty the Robot · Programming Concepts 2 . Lesson 1 – Introduction to...
Transcript of Programming Concepts 2 - Marty the Robot · Programming Concepts 2 . Lesson 1 – Introduction to...
Student Name:
Marty the Robot Workbook
Programming Concepts 2
Lesson 1 – Introduction to Logic Operators
What do you think will happen if we run the following code blocks?
What do we call something like move? I’ll give you a hint – it
begins with v…….
See if you can think up some more examples using the Boolean operators presented in class
IF I eat all of my dinner AND I help to clear the table THEN
I can get ice cream for dessert
IF today is Monday OR today is Thursday THEN I have coding club after school
IF today is NOT Friday THEN I have homework to do
Can you help Marty predict what will happen when we run these programs?
This last one is tricky! You might want to try putting it in Scratch
to test it!!
Lesson 2 – Introduction to Functions We use functions every single day without realising it! How many can you
think of?? We have given a few examples to get you started!
Functions
Brushing your teeth
Eating
Getting ready for bed
Function Name: Plan:
Function Name: Plan:
Function Name: Plan:
Plan out the different
moves you want to include in my new
dance routine!
Lesson 3 – Introduction to Parameters
What do you think will happen when we run the following code?
The values that we pass in are called
Parameters!
Try filling in the blanks!
Move our sprite 20 steps
Walk in a square
Walk in a square using our function
Use this space to help plan out your program!
Lesson 4 – Teaching Marty How to Walk Colour in BLUE the joints that will be moving when Marty takes a step with his LEFT foot Colour in RED where you think Marty’s weight will shift to when he takes a step with his LEFT foot
Use the space below to plan out your code for programming Marty to step with his left and right feet!
LEFT FOOT
RIGHT FOOT
Lesson 5 – Obstacle Course Challenge 1
Draw some pictures of the different robots that you spoke about in class and the environment that they work in!
Remember, robots are
built to work in a specific environment. I wouldn’t be very good
underwater!!
Draw out your idea for an obstacle course!
Don’t forget to think about what kind of
obstacles I could tackle!
Use the space below to plan out your program!