drekly,

LETTSSS GOOOOOO

vicfic,
@vicfic@iusearchlinux.fyi avatar

fr, I didn’t know dat macros could be used to make nu programming languages.

Dogeek,

#define is nothing but a search and replace from the preprocessor.

I’ve been burned one too many times with #include which replaces the directive with the contents of the included headers file (I think that if you’re truly evil you can even include straight .c files and forgo headers entirely)

MonkderZweite,

The count of imports or the syntax?

moridinbg,

Gen Z++

runner_g,

yeetZ++

Dagu,

You could do this so much better than this

gaussian_distro,

Let’s see what you got.

Chadus_Maximus,

No cap.

HeavenAndHell,
@HeavenAndHell@lemmy.world avatar

Finally, an actual programming language. So long, Fortran.

JoMiran,
@JoMiran@lemmy.ml avatar

Gen-X here. Is it weird that I found the Z++ version easier to read?

BembelSommelier,
@BembelSommelier@feddit.de avatar
lelgenio,

Reminder that yeet is a keyword in rust

csolisr,

Is it synonymous with eject?

rockSlayer,

I was following along until the bussin loop. What is it trying to yeet?

scutiger,

yeet cap rn

It’s right there!

LoafyLemon,

Returns a zero, I think.

aaaa,

I believe it outputs the prime factors of the number you gave it.

The yeet value is just specifying if the function succeeded or not

vahtos,

I found this amusing enough to try it out. It does actually compile (I used g++ for this). However, the current implementation just goes into an infinite loop if you enter a number >= 2.

I think the original author meant to do n -= 1 rn in the tweakin loop that is inside the bussin loop. That way, at some point n % i finna cap will be false, and i will bouta. Which then makes the expression i <= n in the bussin loop eventually false, so we stop bussin and yeet cap rn.

However, that would mean that the intention of the program isn’t to output prime factors, because even with this fix it does not do so. The structure of mf chief() also doesn’t suggest that is the purpose as it is missing another tweakin and sussin like this example of calculating prime factors in C++.

Example run:


<span style="color:#323232;">$ ./zpp.exe
</span><span style="color:#323232;">Enter a number larger than 1: 50
</span><span style="color:#323232;">2
</span><span style="color:#323232;">7
</span><span style="color:#323232;">8
</span><span style="color:#323232;">47
</span>
aaaa,

Yeah it definitely looks like a flawed implementation either way. Probably a student got bored of trying to make it work, and went nuts with the #defines for fun

As a career programmer myself… I can absolutely relate.

BeigeAgenda,
@BeigeAgenda@lemmy.ca avatar

Ages ago downloaded some code for handling volume control for me to extend, it was a VB developer using c and they did the same, I just closed it and found some other code to use. 🙄

Bonehead,

So...you took C++, and turned it into COBOL. I'm not sure if I'm impressed or horrified.

kinttach,

How regular C++ feels if English isn’t your first language

Dasnap,
@Dasnap@lemmy.world avatar
xuxebiko,

Finally! I'm now deadass hip with the new lingo.

Moghul,

This feels like those boomer comics about how dumb millennials are

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • uselessserver093
  • Food
  • aaaaaaacccccccce
  • [email protected]
  • test
  • CafeMeta
  • testmag
  • MUD
  • RhythmGameZone
  • RSS
  • dabs
  • Socialism
  • KbinCafe
  • TheResearchGuardian
  • oklahoma
  • feritale
  • SuperSentai
  • KamenRider
  • All magazines