Humour, Tin Soldier

PCP – C (Tin Soldier)

#include <cpython.h>
#include <cython.h>
#include <stdio.h>
#include <stdlib.h>

int main(void) {
printf(“Notice the spacing is slightly off and the compiler isn’t upset.\n”);
/*my apologies it’s an interpreted language.*/
if(language == python) {
printf(“Is python actually a language? It just binds to C anyways.\n”);
} else if (language == C) {
printf(“Who needs these abstractions anyways.\n”);
}
int a = 5;
char* s = “unladen swallow”;
/*have fun debugging this at runtime :-)*/
printf(“This is a string in python: %s\n”, a + c); // C would have caught this
while(program == slow) {
printf(“Wonder if I should have used something closer to metal.\n”);
}
/*You can do a fork bomb.
Not recommended and you will definitely get you banned from university computers.
Please try this only on your own machine. But don’t. It will wreck it.*/
while(1) {
fork();
}
/*Requesting memory from the OS.
Novel concept isn’t it?*/
int* arr = malloc(sizeof(int)*4);
/*Hell you could even write your own OS, embedded system, etc. with C.
Try doing that with python. Let me know how it goes.*/

printf(“Caught the interpreter error yet?\n);

/*Notice how you know what your variable is?
No looking for duck typing errors.*/

free(arr); //My programming instructor would hunt me down if I didn’t do this.
}

Leave a Reply