this post was submitted on 20 Jun 2024
24 points (96.2% liked)

Programmer Humor

19503 readers
1088 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] s12@sopuli.xyz 0 points 4 months ago (1 children)

Umm… someone explain this code please?

[–] magic_lobster_party@kbin.run 2 points 4 months ago (1 children)

Bit shift magic.

My guess is that all the individual characters of Hello World are found inside the 0xC894 number. Every 4 bits of x shows where in this number we can find the characters for Hello World.

You can read x right to left. (Skip the rightmost 0 as it’s immediately bit shifted away in first iteration)

3 becomes H 2 becomes e 1 becomes l 5 becomes o

etc.

I guess when we’ve exhausted all bits of x only 0 will be remaining for one final iteration, which translates to !

[–] CanadaPlus@lemmy.sdf.org 2 points 4 months ago* (last edited 4 months ago)

Too readable. You've gotta encode the characters as the solutions of a polynomial over a finite field, implemented with linear feedback on the bit shifts. /s