Journal Ashtead's Journal: Shiver me timbers! 3
/* For today: */
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h> /* Arrg! */
typedef int Pirates;
typedef char Shiver;
#define give_us printf
#define Avast for
#define Arrh if
#define Prepare strtol
typedef void *the_plank;
Pirates /* of the C */ main( Pirates ARRGC, Shiver **ARRGV)
{
Pirates thar_ye, scurvy_dog, Maties;
Shiver *me_timbers;
Pirates Yo_ho_ho, bottle_of_rum;
Maties = 1;
scurvy_dog = Maties-Maties;
bottle_of_rum = Maties+Maties;
Arrh(ARRGC >= bottle_of_rum)
{
Yo_ho_ho = Prepare(ARRGV[Maties], (Shiver **) &me_timbers, scurvy_dog);
}
Avast(thar_ye = scurvy_dog; thar_ye < ARRGC; thar_ye++)
{
give_us("Avast %d %d yer booty = %s %d\n",
thar_ye, scurvy_dog, ARRGV[thar_ye], Yo_ho_ho & bottle_of_rum);
}
return(ARRGC);
}
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
typedef int Pirates;
typedef char Shiver;
#define give_us printf
#define Avast for
#define Arrh if
#define Prepare strtol
typedef void *the_plank;
Pirates
{
Pirates thar_ye, scurvy_dog, Maties;
Shiver *me_timbers;
Pirates Yo_ho_ho, bottle_of_rum;
Maties = 1;
scurvy_dog = Maties-Maties;
bottle_of_rum = Maties+Maties;
Arrh(ARRGC >= bottle_of_rum)
{
Yo_ho_ho = Prepare(ARRGV[Maties], (Shiver **) &me_timbers, scurvy_dog);
}
Avast(thar_ye = scurvy_dog; thar_ye < ARRGC; thar_ye++)
{
give_us("Avast %d %d yer booty = %s %d\n",
thar_ye, scurvy_dog, ARRGV[thar_ye], Yo_ho_ho & bottle_of_rum);
}
return(ARRGC);
}
Is this... (Score:2)
Re: (Score:2)
The above is mine. I just took one of my favorite eight-line test programs (one that basically prints out all its command-line arguments), and made some replacements and embellishments on that. It is amazing what can be done with the preprocessor and typedef whilst rendering the results still palatable to a compiler. :-)
I think I'd prefer to license it under the GPL, so that I get to see whatever other extensions others might have made to it, come next September 19. As I spent some 30 minutes on it, chan
Well done (Score:2)
That's worth a friending.
I am not worthy.