PDA

View Full Version : Greetings from C and Python


aleph
24th December 2008, 09:12 AM
Inspired by this (http://www.gnu.org/fun/jokes/happy-new-year.cfbC.html), I wrote a piece of very simple code today that says "Merry Christmas" in 2 languages.

The code goes like this:
#include <stdio.h>
#define main() int main(void){printf("Merry Christmas and Happy New Year!\n From C land, with love.\n");return 0;}
#define BE_HAPPY /*
def main(): print "Merry Christmas and Happy New Year!\n From Python land, with love."
#*/
main()


http://img372.imageshack.us/img372/7753/polyglotcm1.gif (http://img372.imageshack.us/my.php?image=polyglotcm1.gif)

It can either be compiled with GCC or be interpreted by Python.

PabloTwo
24th December 2008, 03:35 PM
Very clever with the animated .gif image. First time I've seen that on the forum other than those (mostly annoying) animated Avatars.

Cheers to all

aleph
24th December 2008, 04:07 PM

@Pablo

Thanks ;-)

The animated image was made using GIMP. It is fairly small (only 27kB in size) because GIMP is smart enough to save only the "diff" between frames:)