logoalt Hacker News

andaitoday at 5:00 PM6 repliesview on HN

Excellent. At last, I can I confess a far worse crime.

Late 2020, pre-AI, which I'm not sure if that makes it better or worse...

  #include "uwu.h"
  #include <stdio.h>

  iwint main() stawt
      iwint owo is 5 yiff
      fuw (iwint uwu is 0 yiff uwu smol owo yiff uwu incwease) stawt
          owo is owo wif uwu yiff
          spweak nuwumber_fowmat, owo spwake yiff
      stawp
  stawp
--

  // uwu.h

  #define is =
  #define yiff ;
  #define stawt {
  #define stawp }
  #define fuw for
  #define iwint int
  #define wif +
  #define wiffout -
  #define smol <
  #define larg >
  #define incwease ++
  #define spweak printf(
  #define spwake );
  #define nuwumber_fowmat "%d\n"
Obviously this one also runs DOOM ;)

Replies

kmosertoday at 7:17 PM

I did this in 1989, as if C had been written by the folks who brought you COBOL:

  #include <stdio.h>

  #define OpenBrace {
  #define CloseBrace }
  #define OpenBracket [
  #define CloseBracket ]
  #define OpenParenthesis (
  #define CloseParenthesis )
  #define NoReturnType void
  #define NoParameter NoReturnType
  #define MainFunction main
  #define Semicolon ;
  #define FunctionPrototype
  #define ActualFunction
  #define PointerTo(atype) atype*
  #define OutputToStdout(astring) printf(astring)
  #define IsEqualTo =

  FunctionPrototype NoReturnType
  MainFunction OpenParenthesis NoParameter CloseParenthesis Semicolon

  ActualFunction NoReturnType
  MainFunction OpenParenthesis NoParameter CloseParenthesis
  OpenBrace
    PointerTo(char) string IsEqualTo "Now is the time for all good men, etc.\n" Semicolon
    OutputToStdout(string) Semicolon
  CloseBrace
show 1 reply
jraphtoday at 5:29 PM

I did the same thing, shouting.h, defined the uppercase version of many types and keywords.

Had a good uncontrolled laugh during a team presentation with a colleague. It was a bit disrespectful for the poor presenter who had nothing to do with this…

Can't find shouting.h anymore unfortunately.

giancarlostorotoday at 7:27 PM

Reminds me of my "BASIC" #define statements I made in college to make C look slightly more BASIC-like, I think everyone does this the moment they realize they can do this in C.

show 1 reply
Cshayatoday at 5:24 PM

this gave me such a good chuckle :p

subscribedtoday at 6:03 PM

uwu, this is amazing ;3

Tallaintoday at 6:58 PM

Thanks! I hate it!

In awe at whatever inspired this though