This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while True: | |
time = robot.updatecurrenttime() | |
if time == "morning": | |
morning_counter = 0 | |
while pet.is_sleeping() and morning_counter < 3: | |
robot.comebacklater() | |
morning_counter += 1 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
repeat process everyday: | |
when it is morning time: | |
if the pet is sleeping, repeat: | |
leave for 1 hour and then come back; | |
until: the pet wakes up OR if the robot has left for 3 times | |
clean the cage and refill the food and water; | |
if the pet is still sleeping: | |
robot sends a notification to my phone: "The pet might be sick!"; | |
when it is noon OR night time: |