Re:Kill hashtables, get shorter code.
by Groxx on Monday July 19, 2010 @04:57PM
(#1530139)
Oh, I know it. And I would never put it in a project I'd expect other people to read, much less in a large project. I've got stuff like that in some of the easier Project Euler solutions, because I don't want to solve them in the most rational fashion.
edit: my most-epic-single-line is a range definition, and I actually use this one as-is with a description of how it works:
If passed a prefix, this iterates over all array entries where the index matches /^prefix/ (one-based, I have a zero-based too), entirely skipping non-matching ones. Just need to increase scale appropriately, and loop until it finds nothing. It was fun to come up with.
edit: my most-epic-single-line is a range definition, and I actually use this one as-is with a description of how it works:
If passed a prefix, this iterates over all array entries where the index matches /^prefix/ (one-based, I have a zero-based too), entirely skipping non-matching ones. Just need to increase scale appropriately, and loop until it finds nothing. It was fun to come up with.