In the past 15 years, Gray code is the only part of my Computer Science education I've actually found a use for in my day-to-day work developing business applications. I've used it to simplify overly complex if/else logic down to its simplest possible form. All the rest of the knowledge I use on a daily basis has been learned on the job.
Could you expand on that? I don't really understand how you could simplify if/else logic by using this which is a bijection from one binary counting system to another.
Made a tiny webapp to do this, which lets you hover over the different parts of the resulting expression, to see which parts of the karnaugh map they cover: https://github.com/ysangkok/py-kmap
I count in Gray code using my fingers. It's twice as fast as binary because the LSB switches half as often! I've also found patterns that are even better, but they're harder to learn.
That's so cool. When I was a kid, I had a panel with a ton of switches. I've been thinking about the way to cycle through all of the possible switch combinations (I already knew combinatorics and binary), and I invented Gray codes in the process :)
I never thought it could be useful for anything but my amusement.