3 ms·
The clever part here is that it's defined as: for(i=4;i--;) instead of the more common (off by one?) for(i=4; i > 0; i--) syntax
by maaaats 13y ago
The clever part here is that it's defined as:
for(i=4;i--;)
instead of the more common (off by one?)
for(i=4; i > 0; i--) syntax
- waterlion 13y agoThat is clever.
- xmonkee 13y agoI recommend reading K&R (http://en.wikipedia.org/wiki/The_C_Programming_Language http://en.wikipedia.org/wiki/The_C_Programming_Language) if you haven't already. It's got all sorts of elegant tricks like this. But of course it depends on very particular implementation details at times.
- waterlion 13y agoDon't worry, I have (hence my disbelief at the first comment). Funny we've come full circle (via e.g. Java) back to the point where that is valid code.