Created
March 12, 2019 20:19
-
-
Save aaelamine/ff9cb6572caa93d173892c3d89b4c82a to your computer and use it in GitHub Desktop.
Robot pet caring code - Toy Example
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 | |
robot.cleancage() | |
robot.refillfoodwater() | |
if pet.is_sleeping() and morning_counter == 3: | |
robot.sendnotification("The pet might be sick!") | |
elif time == "noon" or "night": | |
robot.refillfoodwater() | |
else: | |
robot.playwithpet() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment