#1 Members - Reputation: 534
Posted 21 July 2012 - 07:56 PM
#3 Members - Reputation: 1872
Posted 21 July 2012 - 08:53 PM
Edited by fastcall22, 21 July 2012 - 09:03 PM.
#4 Members - Reputation: 595
Posted 22 July 2012 - 10:39 AM
You mean, create a gigantic one-line file ... several megabytes ... somehow i doubt OP will find it acceptable :/Include the contents of the header and expand all the macros into one line?
/me has been hit with a similar problem in the past (macro-based boiler-plate code-gen issues) and i did not find any workarounds, i doubt there is any (besides adding a custom compilation step before preprocessor).
Edited by tanzanite7, 22 July 2012 - 10:40 AM.
#5 Members - Reputation: 3503
Posted 22 July 2012 - 11:12 AM
1) Including several hundred lines of iostream code into your own isn't a 1 line program. If you are going to do that, you might as well just include an entire program and have your 1 line be Go();
2) 'Lines' is a useless metric. C++ is freeform and lines are just whitespace to be stripped out anyways. Cramming 15 statements into one line doesn't make it a 1 line program. It's just a poorly formatted 15 line program.
Edited by Daaark, 22 July 2012 - 11:13 AM.
#6 Members - Reputation: 273
Posted 22 July 2012 - 11:33 AM
I agree with Daaark that lines are a useless metric. I suppose a better one is exe file size. There are impressive 3d tech demos out on the internet including music and it all fits within 64KB limit.
#7 Members - Reputation: 595
Posted 22 July 2012 - 11:38 AM
Don't know what OP had in mind, but i think you are missing the point.
It is NOT intended to be useful nor well readable etc. It is a challenge, bonus points if the code does something interesting. Check for example this (at the top of Ken Perlin's homepage).
Edited by tanzanite7, 22 July 2012 - 11:39 AM.
#8 Members - Reputation: 1349
Posted 22 July 2012 - 02:52 PM
C++: A Dialog | C++0x Features: Part1 (lambdas, auto, static_assert) , Part 2 (rvalue references) , Part 3 (decltype) | Write Games | Fix Your Timestep!






