Programming Concepts 2 - Marty the Robot · Programming Concepts 2 . Lesson 1 – Introduction to...

20
Student Name: Marty the Robot Workbook Programming Concepts 2

Transcript of Programming Concepts 2 - Marty the Robot · Programming Concepts 2 . Lesson 1 – Introduction to...

Page 1: Programming Concepts 2 - Marty the Robot · Programming Concepts 2 . Lesson 1 – Introduction to Logic Operators What do you think will happen if we run the following code blocks?

Student Name:

Marty the Robot Workbook

Programming Concepts 2

Page 2: Programming Concepts 2 - Marty the Robot · Programming Concepts 2 . Lesson 1 – Introduction to Logic Operators What do you think will happen if we run the following code blocks?
Page 3: Programming Concepts 2 - Marty the Robot · Programming Concepts 2 . Lesson 1 – Introduction to Logic Operators What do you think will happen if we run the following code blocks?

Lesson 1 – Introduction to Logic Operators

What do you think will happen if we run the following code blocks?

Page 4: Programming Concepts 2 - Marty the Robot · 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…….

Page 5: Programming Concepts 2 - Marty the Robot · Programming Concepts 2 . Lesson 1 – Introduction to Logic Operators What do you think will happen if we run the following code blocks?

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

Page 6: Programming Concepts 2 - Marty the Robot · Programming Concepts 2 . Lesson 1 – Introduction to Logic Operators What do you think will happen if we run the following code blocks?

IF today is NOT Friday THEN I have homework to do

Page 7: Programming Concepts 2 - Marty the Robot · Programming Concepts 2 . Lesson 1 – Introduction to Logic Operators What do you think will happen if we run the following code blocks?

Can you help Marty predict what will happen when we run these programs?

Page 8: Programming Concepts 2 - Marty the Robot · Programming Concepts 2 . Lesson 1 – Introduction to Logic Operators What do you think will happen if we run the following code blocks?

This last one is tricky! You might want to try putting it in Scratch

to test it!!

Page 9: Programming Concepts 2 - Marty the Robot · Programming Concepts 2 . Lesson 1 – Introduction to Logic Operators What do you think will happen if we run the following code blocks?

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

Page 10: Programming Concepts 2 - Marty the Robot · Programming Concepts 2 . Lesson 1 – Introduction to Logic Operators What do you think will happen if we run the following code blocks?

Function Name: Plan:

Function Name: Plan:

Function Name: Plan:

Plan out the different

moves you want to include in my new

dance routine!

Page 11: Programming Concepts 2 - Marty the Robot · Programming Concepts 2 . Lesson 1 – Introduction to Logic Operators What do you think will happen if we run the following code blocks?

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!

Page 12: Programming Concepts 2 - Marty the Robot · Programming Concepts 2 . Lesson 1 – Introduction to Logic Operators What do you think will happen if we run the following code blocks?

Try filling in the blanks!

Move our sprite 20 steps

Walk in a square

Page 13: Programming Concepts 2 - Marty the Robot · Programming Concepts 2 . Lesson 1 – Introduction to Logic Operators What do you think will happen if we run the following code blocks?

Walk in a square using our function

Use this space to help plan out your program!

Page 14: Programming Concepts 2 - Marty the Robot · Programming Concepts 2 . Lesson 1 – Introduction to Logic Operators What do you think will happen if we run the following code blocks?

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

Page 15: Programming Concepts 2 - Marty the Robot · Programming Concepts 2 . Lesson 1 – Introduction to Logic Operators What do you think will happen if we run the following code blocks?

Use the space below to plan out your code for programming Marty to step with his left and right feet!

LEFT FOOT

RIGHT FOOT

Page 16: Programming Concepts 2 - Marty the Robot · Programming Concepts 2 . Lesson 1 – Introduction to Logic Operators What do you think will happen if we run the following code blocks?

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!!

Page 17: Programming Concepts 2 - Marty the Robot · Programming Concepts 2 . Lesson 1 – Introduction to Logic Operators What do you think will happen if we run the following code blocks?

Draw out your idea for an obstacle course!

Don’t forget to think about what kind of

obstacles I could tackle!

Page 18: Programming Concepts 2 - Marty the Robot · Programming Concepts 2 . Lesson 1 – Introduction to Logic Operators What do you think will happen if we run the following code blocks?

Use the space below to plan out your program!

Page 19: Programming Concepts 2 - Marty the Robot · Programming Concepts 2 . Lesson 1 – Introduction to Logic Operators What do you think will happen if we run the following code blocks?
Page 20: Programming Concepts 2 - Marty the Robot · Programming Concepts 2 . Lesson 1 – Introduction to Logic Operators What do you think will happen if we run the following code blocks?