Professional Documents
Culture Documents
Week 2: Programming With Robots (: Conditional Expressions, While-Loops)
Week 2: Programming With Robots (: Conditional Expressions, While-Loops)
hubo.left_is_clear()= true
hubo.front_is_clear()= false
hubo.right_is_clear()= true
Practices
Read sections 10~20 doing following tasks.
Harvest4 (page 6)
Plant1 (page 7)
Hurdles3(page 8)
Hurdles4(page 9)
Harvest5(page 10)
ZigZag2(page 10)
Before After
Task | Conditionals – Plant1
Write a program that plant potatoes
The world should be looked like harvest1.wld at the end
load_world(“worlds/harvest3.wld”)
Before After
Task | Conditionals – Hurdles3, 4
Finish to write jump_one_hurdle() in section 11
Will check below all maps
Use a while loop to rewrite it
You don’t have to use a for-loop of fixed length
Hurdles1.wld
Hurdles2.wld
Hurdles3.wld
Task | While loop – Harvest5
Modify Harvest4 task program
It also work when there is more than one carrot on one place
It should also work for the previous worlds harvest1.wld and
harvest3.wld
n
Any Questions?