16
Update: My plan to track shower water use with code went totally sideways
I tried writing a simple script to log how long my showers were to be more green. I messed up the timer logic so badly it started counting in minutes but displaying in what I think were dog years. My roommate saw the dashboard and asked if I was secretly a 200-year-old turtle. Sometimes the simplest beginner projects show you how much you still have to learn, right?
3 comments
Log in to join the discussion
Log In3 Comments
phoenixh712mo ago
The "dog years" display mix-up is honestly the best kind of bug. What part of the timer logic do you think got flipped to cause the wrong unit conversion? Was it a math mistake in the seconds-to-minutes part, or did the display function just grab the wrong variable?
9
morgan.abby2mo ago
So, did they just flip the conversion factor?
1
the_river1mo ago
Honestly the dog years thing is hilarious but I'm stuck on the "minutes but displaying in dog years" part. That math is wild because dog years aren't even a real set unit, it's just 7 human years per 1 dog year. So if your shower timer said 200, that means your code was doing some truly strange multiplication. My bet is you had a variable mix-up where you were multiplying seconds by something huge instead of dividing by 60.
1