0% found this document useful (0 votes)
143 views

Python Hubo Pro9

This document defines functions to control a robot named hubo to drop beepers in a grid world. It creates a 7x7 world and initializes hubo with 36 beepers. Functions are defined to move hubo forward while dropping beepers, turn right, move up one space, and move up and to the right. The main drop_all function calls the other functions to have hubo drop beepers in a grid pattern.

Uploaded by

Hanan Fuad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
143 views

Python Hubo Pro9

This document defines functions to control a robot named hubo to drop beepers in a grid world. It creates a 7x7 world and initializes hubo with 36 beepers. Functions are defined to move hubo forward while dropping beepers, turn right, move up one space, and move up and to the right. The main drop_all function calls the other functions to have hubo drop beepers in a grid pattern.

Uploaded by

Hanan Fuad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

Problem 9:plant 1

from cs1robots import *

Create_world(avenues=7,streets=7)

hubo=Robot(beepers=36)

hubo.set_trace("blue")

hubo.set_pause(0.2)

hubo.move()

def drop_move():

for i in range(6):

not hubo.on_beeper():

hubo.drop_beeper()

else:

hubo_front_is_clear():

hubo.move()

def turn_right():

for i in range(3):

hubo.turn_left()

def go_up():

hubo.turn_left()

hubo.move()

hubo.turn_left()

def go_upright():

turn_right()

hubo.move()

turn_right()
def drop_all():

for i in range(2)

drop_move()

go_up()

drop_move()

go_upright()

drop_all

drop_move()

go_up()

drop_move()

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy