Algorithm for feeding my cat


Here is a fun algorithm that was inspired by

“Algorithm – Feeding a Dog,” by Carl Foster

This algorithm is designed to trigger daily between 7:00pm and 7:30pm (which is dinner time for our cat!)

Please see below… (it’s a long one, I got a bit carried away here!)

  1. Share an algorithm that can be used in different contexts with only minor changes.

 

We all spend a lot of (cumulative) time standing in front of our open refrigerator. This means that the first section (Process 1) of my algorithm (which instructs the opening of a refrigerator door and scanning the contents of the refrigerator) is relevant to everybody and can be easily tweaked to suit 1: refrigerators that open differently and 2: searching for different items in the refrigerator. Other aspects of this algorithm could also be modified to suit contexts such as putting food out on a table, packing up after a meal, retrieving some aloe vera gel from the refrigerator to put on sunburned skin etc.

 

  1. Give an example of a daily activity consisting of multiple steps that could be replaced by a function.

 

Refer to my ‘feeding the cat’ algorithm below! 😊

 

 

 

Full algorithm for the function ‘dinner time’

 

Process 1:

  1. IF time = [1900 – 1930], THEN proceed to ‘dinner time’ process 1b. IF time is less than 1900 OR greater than 1930, wait 15 minutes THEN proceed to ‘dinner time’ process 1a.
  2. Walk to refrigerator
  3. Reach forward with left arm
  4. Grab hold of refrigerator door at lower door handle
  5. Maintain hold of refrigerator door handle and pull elbow back towards body to open lower refrigerator door
  6. Release hold on refrigerator door
  7. Proceed to ‘dinner time’ Process 2a.

 

 

Process 2:

  1. Check floor space behind feet.
  2. IF clear, take one step backward THEN proceed to ‘dinner time’ process 2c.. IF not clear, execute function ‘clear floor space’ THEN proceed to ‘dinner time’ Process 2b.
  3. Flex at hips and lean diagonally down and forward 30 cm to maximise view of refrigerator shelf
  4. Scan for open can of cat food.
  5. IF can of open cat food is visible, store data location of open can THEN proceed to ‘dinner time’ process 2f. IF can of open cat food is not visible execute function ‘new can’ THEN proceed to ‘dinner time’ process 3a.
  6. Grab can of open cat food with left hand.
  7. Maintaining grip on can of cat food with left hand, return to standing position.

 

 

Process 3:

  1. Reach forward with right arm to close refrigerator lower door.
  2. Return right arm to resting position.
  3. Maintaining left-handed grip on can of cat food, walk to the doorway of the laundry.
  4. IF laundry door is open take one small step into laundry THEN proceed to ‘dinner time’ process 3e, IF laundry door is closed execute function ‘open door’ then proceed to ‘dinner time’ process 3d.
  5. Scan laundry for food bowl
  6. IF food bowl is visible THEN proceed to ‘dinner time’ process 3h. IF food bowl is not visible execute function ‘retrieve food bowl’ THEN proceed to ‘dinner time’ process 3h.
  7. Scan food bowl for large pink plastic spoon
  8. IF large pink plastic spoon is visible within food bowl THEN proceed to ‘dinner time’ process 4a. IF large pink plastic spoon is not visible within food bowl execute function ‘retrieve spoon’ THEN proceed to ‘dinner time’ process 4a.

 

 

Process 4:

  1. Place bowl and open can of cat food onto lower laundry shelf.
  2. Grasp handle of large pink plastic spoon with left hand.
  3. Dip scoop of large pink plastic spoon into can.
  4. Slowly lift large pink plastic spoon out of can, concave surface facing upwards.
  5. Scan concave scoop of large pink plastic spoon. IF large pink plastic spoon is full with cat food THEN proceed to ‘dinner time’ process 4f. IF large pink plastic spoon is not full with cat food execute function ‘precision scoop’ THEN proceed to ‘dinner time’ process 4f.
  6. Position large pink plastic spoon over food bowl.
  7. Lower large pink plastic spoon into food bowl.
  8. Rotate large pink plastic spoon so that concave scoop faces downwards. IF food drops from large pink plastic spoon into food bowl THEN proceed to ‘dinner time’ process 5a. IF food doesn’t drop from large pink plastic spoon into food bowl THEN gently tap large pink plastic spoon against inside of food bowl (repeat until food has dropped from large pink plastic spoon into food bowl) and proceed to ‘dinner time’ process 5a.

 

 

Process 5:

  1. Tap large pink plastic spoon against outside of food bowl (repeat x3)
  2. Wait 20 seconds.
  3. IF cat appears in laundry THEN proceed to ‘dinner time’ process 5d. IF cat doesn’t appear in laundry execute function ‘search for cat’ THEN proceed to ‘dinner time’ process 5a.
  4. Place large pink plastic spoon in food bowl in a position where it is not obstructing access to the cat food.
  5. Place food bowl on laundry floor next to cat.
  6. Release grip on food bowl.
  7. Return to standing position.
  8. Wait 5 seconds.
  9. IF cat commences eating food THEN proceed to ‘dinner time’ process 6a. IF cat doesn’t commence eating food then execute function ‘monitor cat wellbeing’ THEN proceed to ‘dinner time’ process 6a.

 

 

Process 6:

  1. Face lower laundry shelf.
  2. Reach forward with right arm.
  3. Grip open can of cat food.
  4. Scan inside of can.
  5. IF can is more than ¼ full THEN proceed to ‘dinner time’ process 6f. IF can is less than ¼ full execute function ‘new can check’ THEN proceed to ‘dinner time’ process 6f. IF can is empty execute function ‘recycle bin’ THEN end ‘dinner time’ function.
  6. Walk to refrigerator
  7. Reach forward with left arm
  8. Grab hold of refrigerator door at lower door handle
  9. Maintain hold of refrigerator door handle and pull elbow back towards body to open lower refrigerator door
  10. Release hold on refrigerator door
  11. Check floor space behind feet.
  12. IF clear, take one step backward THEN proceed to ‘dinner time’ process 6m.. IF not clear, execute function ‘clear floor space’ THEN proceed to ‘dinner time’ Process 2m.
  13. Flex at hips and lean diagonally down and forward 30 cm to maximise view of refrigerator shelf.
  14. Reach forward with left arm.
  15. Access stored data re: can location (‘dinner time’ process 2e)
  16. Replace can at stored location.
  17. Release grip on can and return to standing position.
  18. Reach forward with right arm to close refrigerator lower door.
  19. Return right arm to resting position.
  20. END FUNCTION

+ There are no comments

Add yours