Skip to content

Instantly share code, notes, and snippets.

@dcat
Created October 13, 2014 10:15
Show Gist options
  • Save dcat/39978db634b02f0a0a3a to your computer and use it in GitHub Desktop.
Save dcat/39978db634b02f0a0a3a to your computer and use it in GitHub Desktop.
dcat's horrorcode
/* dcat's horrorcode, compile with; `cc -std=c99 -o echo echo.c` */
extern char write (unsigned, register const char *, unsigned);
static const char C[2] = { ' ', '\n' };
static mprint (char *x) {
register char *s,c;
for (s = x; *s; ++s);
c = write(1, &*x, s-x);
return ! c == s - x;
}
main (int c, char **a) {
--c;
for (register char i=1; i<=c; i++)
mprint(i[a]) || write(1,&(!!(i == c))[C], 1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment