this post was submitted on 27 Jun 2025
755 points (98.6% liked)

Programmer Humor

24555 readers
1700 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 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] VoidJuiceConcentrate@midwest.social 78 points 1 day ago (2 children)

Programming chess as a single lookup table is wild

[–] grendel84@tiny.tilde.website 21 points 1 day ago (1 children)

@VoidJuiceConcentrate @maris

Right?

pretty sure there are more possible chess positions than atoms in the earth (universe?), so even if every atom of our planet were converted to transistors there'd be no way to fully represent all possibilities.

[–] Zink@programming.dev 37 points 1 day ago (4 children)

This was a fun one to look up. https://en.wikipedia.org/wiki/Shannon_number

It looks like the number of valid chess positions is in the neighborhood of 10^40 to 10^44, and the number of atoms in the Earth is around 10^50. Yeah the latter is bigger, but the former is still absolutely huge.

Let's assume we have a magically amazing diamond-based solid state storage system that can represent the state of a chess square by storing it in a single carbon atom. The entire board is stored in a lattice of just 64 atoms. To estimate, let's say the total number of carbon atoms to store everything is 10^42.

Using Avogadro's number, we know that 6.022x10^23 atoms of carbon will weigh about 12 grams. For round numbers again, let's say it's just 10^24 atoms gives you 10 grams.

That gives 10^42 / 10^24 = 10^18 quantities of 10 grams. So 10^19 grams or 10^16 kg. That is like the mass of 100 Mount Everests just in the storage medium that can store multiple bits per atom! That SSD would be the size of a ~~small~~ large moon!

[–] lime@feddit.nu 3 points 20 hours ago (1 children)

i think you did the weight approximation in the wrong order, 10^24^ is a lot bigger than 6×10^23^. so you can probably double the final weight.

[–] Zink@programming.dev 2 points 14 hours ago (2 children)

10^24 is a lot bigger than 6×10^23

Well yeah it’s almost double, but I wrote the comment as a mental estimation of the order of magnitude, so it doesn’t change the substance of the discussion.

I mean at the beginning I arbitrarily picked a number in that 10^40 to 10^44 range and that’s a factor of 1:10,000 rather than 1:2, lol.

[–] JackbyDev@programming.dev 2 points 12 hours ago

Slightly less than double, actually. (Doesn't really change the meat of the argument or anything though.)

[–] lime@feddit.nu 1 points 13 hours ago

yeah yeah, cosmological approximations and all that, but there's still a bit of difference between "planetoid" and "gas giant" :P

[–] CrazyLikeGollum@lemmy.world 5 points 23 hours ago* (last edited 23 hours ago) (2 children)

Assuming your math is correct (and I have no reason to doubt that it is) a mass of 10^16 kg would actually be a pretty small moon or moderately sized asteroid. That's actually roughly the mass of Mars' moon Phobos (which is the 75th largest planetary moon in the Solar System).

[–] Zink@programming.dev 2 points 14 hours ago

I was thinking of 10^16kg diamond storage inside a larger SSD that’s the size of a large moon, similar to how a real SSD has data stored in tiny little slivers of silicon inside a much much larger device.

I should have explained that one better. It’s easy to imply such details to keep text shorter.

[–] Tja@programming.dev 2 points 18 hours ago (1 children)

Out of curiosity, why did you say planetary moon? Is there any other kind?

[–] itslilith@lemmy.blahaj.zone 2 points 17 hours ago (1 children)

Dwarf planets sometimes have moons (e.g. Pluto)

[–] CrazyLikeGollum@lemmy.world 1 points 8 hours ago

Some large asteroids have moons too.

[–] PolarKraken@programming.dev 2 points 22 hours ago* (last edited 22 hours ago) (2 children)

valid chess positions is in the neighborhood of 10^40^ to 10^44^

Lol, big board you're playing with....

[–] Zink@programming.dev 2 points 14 hours ago (1 children)

If you don’t limit it to valid positions/arrangements it’s like 10^120. Closer to the “number of X in the observable universe” caliber of number.

[–] PolarKraken@programming.dev 1 points 13 hours ago

So I think I was wrong, but you are too lmao.

10^120^ is the number of valid game-trees, or valid ~80 move games.

The much smaller number I quoted above, though, IS the valid positions, I was thinking it was actually the trimmed down "truly valid" game-tree sequences.

Isn't math fun? Limitless ways for us to be wrong!

[–] porous_grey_matter@lemmy.ml 6 points 19 hours ago

A position is the arrangement of all the pieces on the board.

[–] Kolanaki@pawb.social 6 points 1 day ago

I would have probably done it in my high school programming class to be funny and also fuck with my teacher, because they were an asshole.