5
My kid asked me to explain loops while we were sorting laundry
I mean, it was a fun way to connect coding to everyday stuff. Idk, maybe it's just me but seeing how loops work in a real task helped both of us get it.
4 comments
Log in to join the discussion
Log In4 Comments
jackson.sage1mo ago
Hey wait, that's actually more like a conditional statement, not a loop. You're checking each piece of laundry for a condition, like "if it's a sock, put it here." A real loop would be doing the same exact thing to each item. Like, folding every shirt the same way, one after another. Still a cool way to teach the basics though.
8
abby_martinez1mo ago
My mom used to do this with baking, where the recipe is the loop and checking if the egg is bad is the if statement. It’s cool how much of life runs on that simple logic.
1
harperr8229d ago
My grandma's knitting patterns are basically nested loops, right? She'd follow a repeat for the whole row but change the stitch based on the count. Kinda like what @jackson.sage said about doing the same thing to each item, but with a twist built in. Makes you see code in old hobbies.
4