It also relies on the languages treatment of integers (autopromotion to double would break it, as would a rounding on integer divide), is hard to follow, would break if there's a global variable called 'did', and is slower because you're calling the bottleneck functions - WriteString and Print, at least twice per line.
It's coders throwing in cute tricks like this into a production system that creates nightmares down the track. It's worse than useless to try to optimise problems like this - it's dangerous. And if you profiled it you'd see that your version is actually slower than most of the others.
It's coders throwing in cute tricks like this into a production system that creates nightmares down the track. It's worse than useless to try to optimise problems like this - it's dangerous. And if you profiled it you'd see that your version is actually slower than most of the others.