06Events_1

06Events_1 - Abstraction, events, tasks Comp 106 3 Basic...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Abstraction, events, tasks Comp 106 3 Basic Programming Constructs • Sequence • Decision • Repetition • ???
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
The Fourth Construct • Sub-programs. • Known as “My Block” in RCX. • Also known as abstraction in computer science • Build more complex programs based on simpler programs • “Layer it on” Do Square Until Sensor While (Touch sensor 1 is not press): Perform program “Square” Stop all motors - Program Square - Repeat 4 times: Forward 1 second Turn right 1.5 second
Background image of page 2
• Do not worry about the sub-programs after it is written. • Problem solving: coming up with individual sub-programs and put it together to solve a problem. • Two approaches: top-down and bottom-up. Built-in Abstraction in RCX • RCX doesn’t care about the configuration of lego blocks. • It only knows that it has motors and sensors. • The command “Forward n seconds” means nothing to the computer. • How come we can ask it to go “Forward”?
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 09/16/2010 for the course COMP 106 taught by Professor Jasonmadar during the Fall '07 term at Capilano.

Page1 / 7

06Events_1 - Abstraction, events, tasks Comp 106 3 Basic...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online