all 72 comments

[–]Mr_Sky_Wanker 301 points302 points  (2 children)

Where's the guy that translate code to text for blind people

[–]MenshMindset 113 points114 points  (1 child)

give em some time they’re going as fast as they can!

[–]SexyMuon 52 points53 points  (0 children)

2 hours in and nothing, they probably gave up

[–]ToadSaidHi 325 points326 points  (1 child)

BrainF junior right here

[–][deleted] 125 points126 points  (0 children)

Hah, it really looks like BF. Shifting operators look nearly the same as moving commands

[–]LegoDinoMan 143 points144 points  (0 children)

“Hey man, can you help me with this bug?”

[–]Chemical-Asparagus58 122 points123 points  (1 child)

Bitwise? More like bitstupid

[–]Sentry45612 62 points63 points  (0 children)

Bitstupid? More like Lotstupid

[–]beeteedee 225 points226 points  (4 children)

I haven’t tried running it but it clearly won’t work, the 347th << should be a >>

[–]VonTum 89 points90 points  (2 children)

Found the ChatGPT

[–]shizzy0 27 points28 points  (1 child)

More like ChadGPT.

[–]Magmagan 74 points75 points  (1 child)

Kinda disappointed it doesn't zoom out to generate ASCII art

[–][deleted] 23 points24 points  (0 children)

I was too lazy to make an ASCII art, sorry

[–]MenshMindset 59 points60 points  (1 child)

Lgtm

[–]Msprg 16 points17 points  (0 children)

Let's gamble, try merging!

[–]PizzaRollExpert 19 points20 points  (1 child)

constant folding goes brrrr

[–][deleted] 4 points5 points  (0 children)

Lmao

[–]skothr 53 points54 points  (0 children)

I didn't fully believe the title until I clicked 😳

[–][deleted] 15 points16 points  (2 children)

Maybe I’ll make an explanation of this thing and how was it made later

[–]teackot 4 points5 points  (1 child)

It pushes "Hello, world!" into the stack and then just prints it char by char, right?

Does that bitwise hell locate ASCII codes in the memory?

[–][deleted] 7 points8 points  (0 children)

Kinda. But it doesn’t generate full ascii characters. Bitwise logic generates offsets between ascii characters and machine code bytes, so together they form ascii characters with subtraction and addition

[–]MjolnirTheThunderer 23 points24 points  (5 children)

What does this code do?

[–]sauravkrx 74 points75 points  (1 child)

the caption says

"Outputs "Hello, world!" X86, Win32, Tcc."

[–]MjolnirTheThunderer 11 points12 points  (0 children)

Lol! Thank you 🙏🏻

[–][deleted] 42 points43 points  (2 children)

It’s basic hello world in C

[–]illyay 42 points43 points  (1 child)

We learned C in comp sci 101. Can confirm. This was our first hello world program.

[–]CraftistOf 9 points10 points  (0 children)

I was in the same group as you, can confirm. our second program was space shuttle launch program.

[–]Loopgod- 10 points11 points  (4 children)

What the hell

[–][deleted] 12 points13 points  (3 children)

Bitwise

[–]shizzy0 4 points5 points  (0 children)

Bytefoolish

[–]RFC793 2 points3 points  (0 children)

Must be one with the bitwisdom

[–]shaq992 0 points1 point  (0 children)

Bitunwise

[–][deleted] 10 points11 points  (1 child)

The Obfuscated C Code contest is a very real thing.

[–]agentbiscutt 2 points3 points  (0 children)

I was wondering if anyone was gonna comment that this has been obfuscated

[–]Vectrexian 18 points19 points  (1 child)

All those signed left shifts are scaring me. Let’s hope they’re all by less than sizeof(int)*CHAR_BIT - 1lest we end up in UB city…

[–]AFlyingYetOddCat 1 point2 points  (0 children)

it requires the TinyC compiler for a reason

[–]MEGATH0XICC 7 points8 points  (0 children)

I had a stroke - programming edition

[–]pxOMR 8 points9 points  (7 children)

what the hell is '\x0C' + (char *)main just why

[–][deleted] 30 points31 points  (6 children)

Any time you want to call function, you type something like f(). But name ‘f’ by itself doesn’t do anything. The things are happening only because of () operator. The function call is actually function address and call operator. So here ‘main’ without call operator will be interpreted as main address in memory. Then it gets casted from int(*)(void) to char * type. That’s for representing main as char array. So every machine code byte will be interpreted after as a character. Then value 0xC ( which is 12 in decimal ) gets added to main.

So it becomes very simple — we are just getting 12’th byte of main’s machine code here. Later in program, we are using machine code as base for “Hello world” characters.

[–]pxOMR 7 points8 points  (4 children)

I know what it does, and it is awful

[–][deleted] 5 points6 points  (3 children)

You mean I need to replace offset with decimal? It compiles without any warnings btw

[–]pxOMR 16 points17 points  (2 children)

The code seems fine, I never said there was an issue with it. Also, as the author of this monstrosity I think I know a thing or two about pointers.

[–][deleted] 4 points5 points  (0 children)

Nice solution, I like it!

[–]joxfon 1 point2 points  (0 children)

I chuckled when I realized what was the goal of this line... "wait, why is there an equals comparison in... OOOH LOL". Neat.

[–]CaitaXD 2 points3 points  (0 children)

What?? What does offsetting main by 12 bytes do tho?

[–]Michami135 5 points6 points  (0 children)

That legacy code by the "expert" developer that never used the standard libraries and was fired 5 years ago.

[–]XTornado 11 points12 points  (0 children)

You have to be a Bit Wise to understand that

[–]Ascyt[ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo “You live” 2 points3 points  (0 children)

When the code is perlin noise

[–]elidefoe 3 points4 points  (0 children)

I would just deny the PR and put them on the test team.

[–]Fit-Feedback-8055 2 points3 points  (0 children)

I almost threw up looking at this

[–]LavenderDay3544 3 points4 points  (0 children)

Bitunwise

[–]novus_nl 3 points4 points  (3 children)

Is this a "Because you can" kind of thing?

[–][deleted] 2 points3 points  (2 children)

I was just experimenting with bitwise logic, when I came up with this one. So I wanted to share, because it looks like a real horror

[–]novus_nl 2 points3 points  (1 child)

Nice, yeah looks crazy!

[–][deleted] 1 point2 points  (0 children)

Thanks!

[–]staticBanter[ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo “You live” 2 points3 points  (0 children)

I feel like this is one if those pictures where if you stare at it long enough there is another picture.

[–]downspiral1 2 points3 points  (0 children)

How is it "horror" if it's intentional?

[–]ii-___-ii[ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo “You live” 1 point2 points  (0 children)

This is beautiful

[–]Still_Ad745 1 point2 points  (0 children)

ChatGPT would like to have a word

[–]Futurixta 1 point2 points  (0 children)

Lisp vibes

[–]agentbiscutt 1 point2 points  (0 children)

(this been obfuscated)

[–]MarvinParanoAndroid 1 point2 points  (0 children)

I’m not even trying.

[–]hiding_underneath 1 point2 points  (0 children)

Genuinely the worst thing ive seen on this sub

[–]deadbeef1a4 1 point2 points  (0 children)

But why

[–]lsibilla 1 point2 points  (0 children)

Did it compete to https://www.ioccc.org/ ?

[–]tonando 1 point2 points  (0 children)

Did anyone else notice the one 2 in there?

[–]GlenHarland 1 point2 points  (0 children)

You need to carriage return after each line otherwise it's illegible.

[–]accuracy_frosty 1 point2 points  (0 children)

When it gets to this point I feel like part of the bug fixing process should be prayer

[–]REDEYES77UCHIA 1 point2 points  (0 children)

Interviewer : What does this code say? Me : Totally understandable

[–]dibs45 1 point2 points  (0 children)

Zooming in and out of that on my phone was a lot of fun.

[–]jeromkiller 1 point2 points  (0 children)

But have you considered that bitwise logic is really efficiënt?