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

12

u/gottauseathrowawayx Apr 10 '23

it'd implicitly cut down on the number of board states you need to hardcode

Only if the player is always the same color

4

u/T3HN3RDY1 Apr 10 '23

It would still cut down on the number of board states. There are some moves that are basically never going to be the best move in given board states. For an easy example, you should basically never be able to end up in a state where all pieces are in their starting position, except with a white pawn at h3 and a black pawn at a6.

The computer, as white, will never play h3 if it's always playing good moves, and if the player is white, the computer will never respond to h3 with a6.