@bronzle@lemm.ee
link
fedilink
19
edit-2
1Y

For those curious:

int main(int argc, char **argv) {
  if ( -- argc != ! 0 ) {
    errx ( ! 0 , "shheiiiit" ) ;
    return ! 0 ;
  }
  
  int number = atoi ( argv[! 0] ) ;

  for ( int i = ! 0 ; i <= number ; ++ i ) {
    printf ( "%3d " , i) ;
    
    if ( i % 3 == 0 ) {
      printf ( "fizz" ) ;
    }
  
    if ( i % 5 == 0 ) {
      printf ( "buzz" ) ;
    }
    printf ( "\n" ) ;
  }
  return 0 ;
}

I’m dumb . does the program do anything?

frfr

Reminds me of lolcode:

HAI 1.2
CAN HAS STDIO?
PLZ OPEN FILE "LOLCATS.TXT"?
    AWSUM THX
        VISIBLE FILE
    O NOES
        INVISIBLE "ERROR!"
KTHXBYE

i am seething with rage

I’m not a C programmer (is this code even C?), but I anticipated seeing comments like this. 😂

It’s like watching a car crash in slow motion trying to read it. I can’t look away…

I threw up in my mouth.

Pro tip: the arguments to main() don’t have to be named argc and argv.

Also, you forgot to #define an alias for atoi, and number, n, and i could’ve been named something more on fleek.

@bronzle@lemm.ee
link
fedilink
6
edit-2
1Y

Also could have takin out mains return type and used sus chief

darcy
link
fedilink
21Y

number is a variable i think

Yes, as are n and i. Do they not deserve ‘fleekness?’

darcy
link
fedilink
11Y

sorry i misread. i thought u meant number was not #define’d

@bronzle@lemm.ee
link
fedilink
1
edit-2
1Y

deleted by creator

@db2@sopuli.xyz
link
fedilink
23
edit-2
1Y

Does it make me a bad person that I like this?

Edit: wait… return ! 0 ; wtf

Edit 2: idc still like it frfr no cap

Edit: wait… return ! 0 ; wtf

I mean, returning non-zero exit status on error is just good practice. It even managed to evaluate to the same numerical value as EXIT_FAILURE when I tested it on my machine (gcc 11.4.0 linux x86-64), although I’m not sure if that’s always the case or if it’s undefined behavior.

This cursed code is quite well-written.

!0 is defined as 1, that’s how argv [ no cap ] works, that and the ridiculous argc check stood out as a bit off, but works

Artistry, on god frfr 🙏🙏

@fluxion@lemmy.world
link
fedilink
English
501Y

And that’s how rappers became the top programmers in the industry

@gpw@lemmy.ml
creator
link
fedilink
241Y

Can’t wait to see Lil Yachty around work

My eyes are bleeding

@gpw@lemmy.ml
creator
link
fedilink
241Y

The path to salvation is filled with terrors and temptation

no cap

Reminds me of Rockstar. The example also implements Fizz Buzz.

That’s my favorite esoteric programming language!

I have to say, I like the substitution of yeet for return. No cap.

Kevin
link
fedilink
English
51Y

Rust has an RFC that wants to consider yeet as a keyword for throwing an exception, I think they’re currently keeping it as a placeholder just in case

AFAIK they’re not seriously considering it as a keyword, but they agreed that in all discussion about the semantics of exceptions they will use “yeet” as a placeholder for the keyword, so people will actually discuss the semantics and not whether the keyword is gonna be “raise”, “throw”, “except” or whatever (so-called Bikeshed Effect)

@gpw@lemmy.ml
creator
link
fedilink
221Y

All of my returns are going to be yeet from now on

My code reviewers will respond to my commits with on god 🙏

My manager will do girl math to determine my next raise

#zoom

Create a post

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

  • Posts must be relevant to programming, programmers, or computer science.
  • No NSFW content.
  • Jokes must be in good taste. No hate speech, bigotry, etc.
  • 1 user online
  • 120 users / day
  • 257 users / week
  • 744 users / month
  • 3.72K users / 6 months
  • 1 subscriber
  • 1.48K Posts
  • 32.6K Comments
  • Modlog