|Don't ask to ask, just ask|
Friday Golf: All 2-digit combinationsby PhilHibbs (Hermit)
|on Sep 26, 2003 at 12:24 UTC||Need Help??|
Display a sequence of digits that contains every 2-digit pair once only. A sample program is provided.
To clarify, the output must contain all 100 combinations of two digits. It must contain '01' and '10', for example, but '010' would count for both of those pairs. '0110' would count as containing '01', '11', and '10'.
A two stroke bonus will be awarded for a sequence that is not just a (00..99).
Update: I fixed (well, bodged) my solution! Also, the two-stroke bonus is rather pointless, as other solutions are shorter anyway. My lack of imagination there, I'm afraid. I should have said "for code that does not itself contain any 2-digit pairs". Is it unfair to change the rules now? I don't think it changes the running order ATM.
I can get within a dozen characters of a hard-coded print statement (138 strokes):
Update: Fixed dumb mistake - missing '' around ..
Here is some code that you can use to test your output: