paolo’s puzzle (of death)
i solved it! i solved it! on the third day too! gosh, i feel like jesus!
you know you’re screwed when you need to use three or more indentations in your program. in my case, it’s 7 fucking nested for loops.
i _would_ post the code i concocted in all of it’s unadulterated monstrosity but, let the following command spare you from wasting your time.
amerei@heaven ~/git/null $ wc -l puzzle.c 101 puzzle.c
compilation is a bit ricer-ish. and i also had my fingers crossed.
amerei@heaven ~/git/null $ gcc -funroll-all-loops -fomit-frame-pointer \ -march=pentium3 -o puzzle puzzle.c
and finally, i took the plunge.
amerei@heaven ~/git/null $ time ./puzzle 17 * 4 ---- 68 + 25 ---- 93 it took 2745 loops. real 0m0.003s user 0m0.000s sys 0m0.002s
there you go. all digits from 1 to 9 arranged in the magic order. no repetitions. thanks man! i learned a lot from this activity. the three days i spent trying to finish the code was never boring! i remember waking up at around 3 am to code because my brain refuses stop working on it. i was also weary that if i won’t codify the idea that woke me up in the first place, i’d forget it soon and i’ll lose my rhythm again.
