DEV Community

LisaMLorenz
LisaMLorenz

Posted on

Thinking about Pseudo Coding on a Sunday morning

I just woke up and instead of putting my head down to study coding I went to put away the clean laundry that's drying on a rack. But can I use these chores to train my brain in coding? Absolutely, as the lesson told my I just watched!

Decomposition/Pattern Recognition/Abstraction/Algorithm

//Decomposition: Put away the dry clothes
//Put away my own clothes
//Put away my partner's clothes (don't worry, we take turns)
//Put away socks

//Pattern Recognition:
//My clothes go into my own wardrobe
//My partners' go into his
//All socks go into a box inside my partner's wardrobe

//Abstraction
//Ignore clothes that are still a bit damp.

//Sequence:
//Put away all clothes.
// Conditional: if(piece of clothing is not clean){
// put it inthe laundry basket
// }else if(a piece of clothing is mine){
// put folded piece in my wardrobe
// }else if{
// put folded piece in my partner's wardrobe
// }
// Loop: (for all socks on the drying rack){
// put in partner's wardrobe but in a separate drawer
// }

I think this makes sense? Will try to play this through in my head of other activities. It's fun :)

Top comments (0)