Skip to content

Instantly share code, notes, and snippets.

@aaelamine
Created March 12, 2019 20:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aaelamine/ff9cb6572caa93d173892c3d89b4c82a to your computer and use it in GitHub Desktop.
Save aaelamine/ff9cb6572caa93d173892c3d89b4c82a to your computer and use it in GitHub Desktop.
Robot pet caring code - Toy Example
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