Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


#Actualslicer4ever

Posted 05 July 2013 - 10:03 PM



I'm disappointed I haven't been seeing more obfuscated C++ tricks like using the preprocessor definitions and implicit string concatenation to shrink the string literals. For instance, "bottles of beer" is repeated in a number of places in both of those code samples so you can use things like

#define B "bottles of beer"
printf("No more " B " on the wall, no more " B ".\n"
You guys are actually producing readable code.

 

challanged accepted: http://codepad.org/jHzuL4zd

 

not sure what you guys are using to do non-whitespace counting, but i don't feel like counting them all to give a number.

 

edit: made minor fix.


#1slicer4ever

Posted 05 July 2013 - 10:02 PM



I'm disappointed I haven't been seeing more obfuscated C++ tricks like using the preprocessor definitions and implicit string concatenation to shrink the string literals. For instance, "bottles of beer" is repeated in a number of places in both of those code samples so you can use things like

#define B "bottles of beer"
printf("No more " B " on the wall, no more " B ".\n"
You guys are actually producing readable code.

 

challanged accepted: http://codepad.org/kkn6FIG5

 

not sure what you guys are using to do non-whitespace counting, but i don't feel like counting them all to give a number.


PARTNERS