scratch - a+ computer science · scratch ifs/loops © a+ computer science - when the green flag is...

26
SCRATCH Ifs/Loops © A+ Computer Science - www.apluscompsci.com

Upload: others

Post on 12-Jul-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: SCRATCH - A+ Computer Science · SCRATCH Ifs/Loops © A+ Computer Science -  When the green flag is clicked, the Bug will say "looping" for 2 seconds and

SCRATCH

Ifs/Loops

© A+ Computer Science - www.apluscompsci.com

Page 2: SCRATCH - A+ Computer Science · SCRATCH Ifs/Loops © A+ Computer Science -  When the green flag is clicked, the Bug will say "looping" for 2 seconds and

SCRATCH

Ifs/Loops

© A+ Computer Science - www.apluscompsci.com

Visit us at

www.apluscompsci.com

Full Curriculum Solutions

M/C Review Question Banks

Live Programming Problems

Tons of great content!

www.facebook.com/APlusComputerScience

Page 3: SCRATCH - A+ Computer Science · SCRATCH Ifs/Loops © A+ Computer Science -  When the green flag is clicked, the Bug will say "looping" for 2 seconds and

SCRATCH

Ifs/Loops

© A+ Computer Science - www.apluscompsci.com

Page 4: SCRATCH - A+ Computer Science · SCRATCH Ifs/Loops © A+ Computer Science -  When the green flag is clicked, the Bug will say "looping" for 2 seconds and

SCRATCH

Ifs/Loops

© A+ Computer Science - www.apluscompsci.com

Until I can hear the song Make it louder

Loops repeat as long as something is true

Page 5: SCRATCH - A+ Computer Science · SCRATCH Ifs/Loops © A+ Computer Science -  When the green flag is clicked, the Bug will say "looping" for 2 seconds and

SCRATCH

Ifs/Loops

© A+ Computer Science - www.apluscompsci.com

As long as I am hungry I eat something

While I have pretzels I eat one

Page 6: SCRATCH - A+ Computer Science · SCRATCH Ifs/Loops © A+ Computer Science -  When the green flag is clicked, the Bug will say "looping" for 2 seconds and

SCRATCH

Ifs/Loops

© A+ Computer Science - www.apluscompsci.com

loop if ( student is hungry and more pretzels left ) { student will eat 1 pretzel stick }

condition

Page 7: SCRATCH - A+ Computer Science · SCRATCH Ifs/Loops © A+ Computer Science -  When the green flag is clicked, the Bug will say "looping" for 2 seconds and

SCRATCH

Ifs/Loops

© A+ Computer Science - www.apluscompsci.com

Loops are used to repeat a command or set of commands forever or for a set number of times.

Page 8: SCRATCH - A+ Computer Science · SCRATCH Ifs/Loops © A+ Computer Science -  When the green flag is clicked, the Bug will say "looping" for 2 seconds and

SCRATCH

Ifs/Loops

© A+ Computer Science - www.apluscompsci.com

When the green flag is clicked, the Bug will say "looping" for 2 seconds and then wait 2 seconds before saying it again. This loop will run forever.

Page 9: SCRATCH - A+ Computer Science · SCRATCH Ifs/Loops © A+ Computer Science -  When the green flag is clicked, the Bug will say "looping" for 2 seconds and

SCRATCH

Ifs/Loops

© A+ Computer Science - www.apluscompsci.com

Page 10: SCRATCH - A+ Computer Science · SCRATCH Ifs/Loops © A+ Computer Science -  When the green flag is clicked, the Bug will say "looping" for 2 seconds and

SCRATCH

Ifs/Loops

© A+ Computer Science - www.apluscompsci.com

Page 11: SCRATCH - A+ Computer Science · SCRATCH Ifs/Loops © A+ Computer Science -  When the green flag is clicked, the Bug will say "looping" for 2 seconds and

SCRATCH

Ifs/Loops

© A+ Computer Science - www.apluscompsci.com

Visit us at

www.apluscompsci.com

Full Curriculum Solutions

M/C Review Question Banks

Live Programming Problems

Tons of great content!

www.facebook.com/APlusComputerScience

Page 12: SCRATCH - A+ Computer Science · SCRATCH Ifs/Loops © A+ Computer Science -  When the green flag is clicked, the Bug will say "looping" for 2 seconds and

SCRATCH

Ifs/Loops

© A+ Computer Science - www.apluscompsci.com

When the green flag is clicked, the Bug will say "looping" for 2 seconds and then wait 2 seconds before saying it again. This loop will run 5 times and then stop.

Page 13: SCRATCH - A+ Computer Science · SCRATCH Ifs/Loops © A+ Computer Science -  When the green flag is clicked, the Bug will say "looping" for 2 seconds and

SCRATCH

Ifs/Loops

© A+ Computer Science - www.apluscompsci.com

Page 14: SCRATCH - A+ Computer Science · SCRATCH Ifs/Loops © A+ Computer Science -  When the green flag is clicked, the Bug will say "looping" for 2 seconds and

SCRATCH

Ifs/Loops

© A+ Computer Science - www.apluscompsci.com

Page 15: SCRATCH - A+ Computer Science · SCRATCH Ifs/Loops © A+ Computer Science -  When the green flag is clicked, the Bug will say "looping" for 2 seconds and

SCRATCH

Ifs/Loops

© A+ Computer Science - www.apluscompsci.com

Visit us at

www.apluscompsci.com

Full Curriculum Solutions

M/C Review Question Banks

Live Programming Problems

Tons of great content!

www.facebook.com/APlusComputerScience

Page 16: SCRATCH - A+ Computer Science · SCRATCH Ifs/Loops © A+ Computer Science -  When the green flag is clicked, the Bug will say "looping" for 2 seconds and

SCRATCH

Ifs/Loops

© A+ Computer Science - www.apluscompsci.com

Page 17: SCRATCH - A+ Computer Science · SCRATCH Ifs/Loops © A+ Computer Science -  When the green flag is clicked, the Bug will say "looping" for 2 seconds and

SCRATCH

Ifs/Loops

© A+ Computer Science - www.apluscompsci.com

if I am hungry I eat something

if I am tired I go to sleep

Page 18: SCRATCH - A+ Computer Science · SCRATCH Ifs/Loops © A+ Computer Science -  When the green flag is clicked, the Bug will say "looping" for 2 seconds and

SCRATCH

Ifs/Loops

© A+ Computer Science - www.apluscompsci.com

if it is dark I turn a light on

if I can’t hear the song I make it louder

Page 19: SCRATCH - A+ Computer Science · SCRATCH Ifs/Loops © A+ Computer Science -  When the green flag is clicked, the Bug will say "looping" for 2 seconds and

SCRATCH

Ifs/Loops

© A+ Computer Science - www.apluscompsci.com

When the green flag is clicked, the Bug will say ouch each time it is clicked with the mouse.

Page 20: SCRATCH - A+ Computer Science · SCRATCH Ifs/Loops © A+ Computer Science -  When the green flag is clicked, the Bug will say "looping" for 2 seconds and

SCRATCH

Ifs/Loops

© A+ Computer Science - www.apluscompsci.com

Page 21: SCRATCH - A+ Computer Science · SCRATCH Ifs/Loops © A+ Computer Science -  When the green flag is clicked, the Bug will say "looping" for 2 seconds and

SCRATCH

Ifs/Loops

© A+ Computer Science - www.apluscompsci.com

Page 22: SCRATCH - A+ Computer Science · SCRATCH Ifs/Loops © A+ Computer Science -  When the green flag is clicked, the Bug will say "looping" for 2 seconds and

SCRATCH

Ifs/Loops

© A+ Computer Science - www.apluscompsci.com

Visit us at

www.apluscompsci.com

Full Curriculum Solutions

M/C Review Question Banks

Live Programming Problems

Tons of great content!

www.facebook.com/APlusComputerScience

Page 23: SCRATCH - A+ Computer Science · SCRATCH Ifs/Loops © A+ Computer Science -  When the green flag is clicked, the Bug will say "looping" for 2 seconds and

SCRATCH

Ifs/Loops

© A+ Computer Science - www.apluscompsci.com

When the green flag is clicked, the Bug move back and forth across the screen. He will say Wow and Yahoo if he is at a certain position on the screen.

Page 24: SCRATCH - A+ Computer Science · SCRATCH Ifs/Loops © A+ Computer Science -  When the green flag is clicked, the Bug will say "looping" for 2 seconds and

SCRATCH

Ifs/Loops

© A+ Computer Science - www.apluscompsci.com

Page 25: SCRATCH - A+ Computer Science · SCRATCH Ifs/Loops © A+ Computer Science -  When the green flag is clicked, the Bug will say "looping" for 2 seconds and

SCRATCH

Ifs/Loops

© A+ Computer Science - www.apluscompsci.com

Page 26: SCRATCH - A+ Computer Science · SCRATCH Ifs/Loops © A+ Computer Science -  When the green flag is clicked, the Bug will say "looping" for 2 seconds and

SCRATCH

Ifs/Loops

© A+ Computer Science - www.apluscompsci.com