CSE Lecture02.note
CSE Lecture02.note
Spring 2022
Zigzag1*
Hurdles1*
Newspaper delivery
Harvest1
Hurdles2
Harvest2*
Harvest3
>>>hubo =
>>>hubo.move() >>>hubo.turn_left
Robot()
# My first program
from cs1robots import *
create_world()
1
3
4
0
hubo.turn_left() hubo.move()
# turn right and move
hubo.move()
turn_right()
CSEg1101– Lecture Introduction to Computing 14
PRACTICE USING FUNCTIONS 1 ASTU
PROBLEM 1: ZIGZAG1*
Write a program zigzag.py that makes your robot visit
the entire world in a zigzag fashion.
PROBLEM2: HURDLES1*
Hubo has entered a hurdles race with obstacles as in the
world file hurdles1. Write a program that makes Hubo
follow the path indicated below in his way to picking up
a beeper, which is at grid(10,1).
PROBLEM 4: HARVEST1
It's harvest time! Make the robot pick up all the carrots
(represented by beepers) in this garden. The world file is
harvest1.wld. Employ top-down design. Use while-loop.
PROBLEM 5 : HURDLES2*
Do Hurdles1 using for-loops.