ylliX - Online Advertising Network
Vertex AI - Antrophic and Mistral models: Why does it require Imegen access?

cs1robots python module: Robot won’t turn


So i have been trying to solve the rain2.wld file in the cs1robots module. here is the code that i have so far:

from cs1robots import *

load_world("rain2")
h = Robot(avenue=3, street=6, orientation='S', beepers=10)
h.set_trace("blue")
h.set_pause(0.3)

h.drop_beeper()
h.move()

while not h.on_beeper():
    if h.right_is_clear():
        h.drop_beeper()
        h.move()
    elif h.front_is_clear():
        h.move()
    elif h.left_is_clear():
        h.turn_left()

output of the code

so basically i wanted it to check for every “window” and place a beeper there. but this is not doing it.

any help would be very appreciated



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *