Lecture02 Note
Lecture02 Note
Computing
Lecture 2 + HW#1
Fall 2022
Zigzag1*
Hurdles1*
Newspaper delivery
Harvest1
Hurdles2
Harvest2*
Harvest3
# My first program
from cs1robots import *
create_world()
1
3
4
0
hubo.turn_left() hubo.turn_left()
hubo.move()
CSE 1061 – Lecture Introduction to Computing 13
TURNING RIGHT (3/3) ASTU
hubo.turn_left() hubo.move()
# turn right and move
hubo.move()
turn_right()
CSE 1061 – 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 car-
rots (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.