r/ProgrammerHumor • • Apr 10 '23

Meme god why is coding chess so hard

Post image
67.4k Upvotes

1.8k comments sorted by

View all comments

Show parent comments

1.0k

u/BestNick118 Apr 10 '23

The number of distinct chess positions after White’s first move is 20 (16 pawn moves and 4 knight moves). There are 400 distinct chess positions after two moves (first move for White, followed by first move for Black). There are 5,362 distinct chess positions or 8,902 total positions after three moves (White’s second move). There are 71,852 distinct chess positions or 197,742 total positions after four moves (two moves for White and two moves for Black). There are 809,896 distinct positions or 4, 897,256 total positions after 5 moves. There are 9,132,484 distinct positions or 120,921,506 total positions after 6 moves (three moves for White and three moves for Black). The total number of chess positions after 7 moves is 3,284,294,545. The total number of chess positions is about 2x10 to the 46 power, so pretty long

958

u/wascilly_wabbit Apr 10 '23

So you're saying it is doable.

615

u/Cwmagain Apr 10 '23

Sounds like a job for chatGTP

282

u/wascilly_wabbit Apr 10 '23

Do you think we could write some Excel functions to help write the code?

141

u/Portlander Apr 10 '23

ChatGPT can write those too

→ More replies (7)

121

u/Xatraxalian Apr 10 '23

"ChatGPT, please print every possible legal chess position."

Then the entire world crashes because students all over the world won't be able to ask it to write their dissertation for them.

109

u/rachit7645 Apr 10 '23

Output from ChatGPT: "I'm sorry, but it's not possible to print every possible legal chess position. The number of possible chess positions is estimated to be around 10120, which is an incredibly large number. It's far beyond what even the most powerful computers can calculate.

To put this into perspective, the number of atoms in the observable universe is estimated to be around 1080, which is much smaller than the number of possible chess positions. Even if we could somehow generate one billion positions per second, it would take billions of years to generate all possible positions.

Therefore, it's not practical to print every possible legal chess position. However, there are databases of previously played chess games available online, which can be studied and analyzed to improve one's understanding of the game."

129

u/EpauletteShark74 Apr 10 '23

So it’s being lazy is what I’m understanding

37

u/lepruhkon Apr 10 '23

Are you my manager?

→ More replies (3)

26

u/obvious_bot Apr 10 '23

I dont want your excuses, robot, I want results!

→ More replies (1)

7

u/RJFerret Apr 10 '23

This is just a management problem, ask it, "ChatGPT, please provide the first ten positions." ... "Now the next ten." ... And so on.

7

u/Intrexa Apr 10 '23

Ooo, chess databases! That's the ticket! We don't need to code every possible move, just the moves players actually play! If a player really makes a move that has never been done before, well, just throw an error. It will be like, a 0.0001% error rate, no big deal.

→ More replies (1)
→ More replies (3)

28

u/JS31415926 Apr 10 '23

Please continue your above response…

35

u/[deleted] Apr 10 '23

[removed] — view removed comment

7

u/PM_ME_FIREFLY_QUOTES Apr 10 '23

That's where we have to draw the line.

→ More replies (2)
→ More replies (2)

11

u/atanasius Apr 10 '23

A 64-bit architecture is required.

→ More replies (2)
→ More replies (19)

0

u/[deleted] Apr 10 '23

[deleted]

76

u/SacredBuster Apr 10 '23

Move it to cloud 🚀🚀🚀!

0

u/[deleted] Apr 10 '23

[deleted]

→ More replies (2)

65

u/TSDLoading Apr 10 '23

There aren't even enough atoms in the universe to save every chess state.

here is a german youtube video explaining why this method will not ever work

22

u/TheChunkMaster Apr 10 '23

We should just make more atoms, then. Someone tell CERN to fire up their particle accelerators. /s

→ More replies (3)

21

u/NaturalBornLucker Apr 10 '23

That's why Hadoop was invented. All you need is big enough cluster

→ More replies (2)
→ More replies (1)

10

u/HaroerHaktak Apr 10 '23

Give me an afternoon. I got this.

→ More replies (1)

6

u/ciaranmcnulty Apr 10 '23

21 I guess (if white resigning is a valid opener)

→ More replies (16)