The Most Beautiful Piece of Code That Prints 42
fluentcpp.com
The Most Beautiful Piece of Code That Prints 42
1–10 of 24 posts
Re: The Most Beautiful Piece of Code That Prints 42
#2Re: The Most Beautiful Piece of Code That Prints 42
#3Like most code, this is way too easy in Perl 6.
> perl6 -e 'say "Life, the Universe and Everything".WHY'
42Re: The Most Beautiful Piece of Code That Prints 42
#4Beautiful code is simple maintainable code. In C this is a simple as:
#include
int main(void) { puts("42"); return 0; }
Re: The Most Beautiful Piece of Code That Prints 42
#5I submitted it already in the linked comments section, but here it is again:
#include
int main(void)
{
std::cout Re: The Most Beautiful Piece of Code That Prints 42
#6ATDT42
(Coz 42 is Gods phone #, duh...)
Re: The Most Beautiful Piece of Code That Prints 42
#7 #include
#define SIX 1+5
#define NINE 8+1
int main(void)
{
printf("%d * %d = %d\n", SIX, NINE, SIX * NINE);
return 0;
}
https://github.com/Keith-S-Thompson/42Re: The Most Beautiful Piece of Code That Prints 42
#8ATDT42 (Coz 42 is Gods phone #, duh...)
MAJIKTHISE:
I mean what’s the use of us sitting up all night saying there may -
VROOMFONDEL: Or may not be
MAJIKTHISE: …or may not be… a god, if this machine comes along the next morning and gives you ‘is telephone number?
Re: The Most Beautiful Piece of Code That Prints 42
#9Beautiful code is simple maintainable code. In C this is a simple as: #include int main(void) { puts("42"); return 0; }
Beautiful code denies its own existence so perfectly you forgot you wrote it
Re: The Most Beautiful Piece of Code That Prints 42
#10It's too bad the code examples have to be in C++. When I saw the prompt, it brought to mind the fabulous Shakespeare Programming Language, which would allow for a more poetic approach:
http://shakespearelang.sourceforge.net/report/shakespeare/sh...