Picture this program

Discussion of challenges you have already solved
Post Reply
chephy
Posts: 17
Joined: Sat Oct 16, 2010 4:39 pm

Picture this program

Post by chephy »

I wonder how people who have not seen the obfuscated C contest entry »Pi« (http://www.cise.ufl.edu/~manuel/obfuscate/pi.c) solve this. Googling? Guessing? Actually trying to make sense of the code?
the hellridden Baron
Posts: 1
Joined: Tue Oct 26, 2010 11:19 pm

Post by the hellridden Baron »

Guessing. :o
Took me (about) 5 seconds after seeing this challenge for the first time. :D
Karian
Posts: 75
Joined: Wed Jan 09, 2008 10:21 am

Post by Karian »

I tried making sense of the code, then going for the guess based on the visual look
AMindForeverVoyaging
Forum Admin
Posts: 496
Joined: Sat May 28, 2011 9:14 am
Location: Germany

Post by AMindForeverVoyaging »

I recognized it immediately because I know of the IOCCC. But I think even if you don't, you could always grab a C compiler and just run the program (and remove the warnings ;)). The result of 3.156 together with looking at the source code reveals the answer pretty quickly.
DaymItzJack
Posts: 106
Joined: Thu Oct 29, 2009 9:21 pm

Post by DaymItzJack »

"What is this attempting to calculate"
"Which numbers do I know...?"
pi.

Straight up guess =/
User avatar
CodeX
Posts: 350
Joined: Fri Oct 17, 2008 5:28 pm

Post by CodeX »

pasting it on codepad would also do the trick, but it probably is too guessable for it's own good
aurora
Posts: 54
Joined: Thu Feb 05, 2009 12:31 pm
Location: Bavaria, Germany

Post by aurora »

guessing [2] ... the answer is imo obvious :-)
haellowyyn
Posts: 6
Joined: Thu Jan 03, 2013 12:13 am

Post by haellowyyn »

Compiling and executing the code gives you '3.156'. Then, it's easy to guess ;)
User avatar
Hippo
Posts: 339
Joined: Sat Feb 01, 2014 12:05 am
Location: Praha 5

Post by Hippo »

Yes, I have decided to run it on online c interpretter and 3.156 was not accepted so I read the challenge forum and answered pi. I have not looked at expanded code till now ... OK each "disk pixel" decrements F, but OO is decremented only on the line start otherwise -F>0 is evaluated to true so OO is not decremented. Therefore F/OO/OO is disk to square ratio ...
Post Reply