Live data from Hacker News

Chess: Who will win in this riveting game of Math.random() vs. Math.random()?

chessboardjs.com

51–60 of 131 posts

Re: Chess: Who will win in this riveting game of Math.random() vs. Math.random()?

#51
post #11
post #7

Because check mate is a very small subset of possible moves at the end game, I'm guessing the vast majority of games will end(?) with 2 kings moving around randomly for all of time. This assumes most games will make it past the hump of mid game where its possible the king's motion will be limited and a checkmate can erroneously happen, I suspect this is a rare case as well. On a side note I wonder what kind of useful…

If it's impossible to checkmate then it's a stalemate. So if one side has one king and the other side one king (or even one king and a pawn, bishop, knight or rook) then it's a stalemate and the game ends. edit: forgot you can checkmate with just a king and a queen

Stalemate is a very specific term that means that the side to move has no legal moves. If checkmate is impossible this is generally called a "draw by insufficient material".

Re: Chess: Who will win in this riveting game of Math.random() vs. Math.random()?

#52
post #48

One thing that is on my (way too long) list of things to try is n-gram chess. 1-gram chess would, for every move from black, have a dictionary of (following move, win probability) pairs, and it would pick one that is legal using the win probabilities to generate a distribution (if there is a sure win, almost always pick it; if there is a move that always lost before, pick it very rarely) You can start this of with em…

Chess engines make use of similar Markov-chain-like techniques, such as killer [1] and history [2] heuristics. They also use win-loss-draw outcomes from millions of grandmaster games in a similar way to build an opening database, to guide them through the opening, the phase which they are weakest at.

[1] https://chessprogramming.wikispaces.com/Killer+Heuristic

[2] https://chessprogramming.wikispaces.com/History+Heuristic

Re: Chess: Who will win in this riveting game of Math.random() vs. Math.random()?

#53
This is strikingly similar to a web interface for chess that I just made, even down to the public domain icons. Really slick, but playing against randomized opponents is not very thrilling. There are also limitations to just optimizing for the best turn with one turn lookahead. Although I have to say the drag and drop is better on this version, I think the problem of trying to find the best move in a client-side web application is relatively tricky. The most naive attempt might use a brute-force method, but this could lock up the web browser. And using large data structures would be taxing, too.

link: http://greg.team-duck.com/chess/

Re: Chess: Who will win in this riveting game of Math.random() vs. Math.random()?

#54
post #48

One thing that is on my (way too long) list of things to try is n-gram chess. 1-gram chess would, for every move from black, have a dictionary of (following move, win probability) pairs, and it would pick one that is legal using the win probabilities to generate a distribution (if there is a sure win, almost always pick it; if there is a move that always lost before, pick it very rarely) You can start this of with em…

I'm trying to figure out how you could store this without having massive dictionaries after a night of training games. I guess it's all just integers which helps.

You could probably just drop moves that are below a certain threshold after every k games.

Re: Chess: Who will win in this riveting game of Math.random() vs. Math.random()?

#56
post #6

I found myself getting mad at Math.random() pretty quickly. "Argh, you just got to promote two pawns, and you made them both black bishops!?!? I oughta fire you and hire an LFSR!"

At least it's no longer allowed to promote to an opponent's piece. Otherwise, I imagine the computer would do that 50% of the time.

Re: Chess: Who will win in this riveting game of Math.random() vs. Math.random()?

#57
post #48

One thing that is on my (way too long) list of things to try is n-gram chess. 1-gram chess would, for every move from black, have a dictionary of (following move, win probability) pairs, and it would pick one that is legal using the win probabilities to generate a distribution (if there is a sure win, almost always pick it; if there is a move that always lost before, pick it very rarely) You can start this of with em…

How is this different from an opening tree?

Re: Chess: Who will win in this riveting game of Math.random() vs. Math.random()?

#59
post #7

Because check mate is a very small subset of possible moves at the end game, I'm guessing the vast majority of games will end(?) with 2 kings moving around randomly for all of time. This assumes most games will make it past the hump of mid game where its possible the king's motion will be limited and a checkmate can erroneously happen, I suspect this is a rare case as well. On a side note I wonder what kind of useful…

I only watched one game, but it seems that:

1) Yes, most games will end in stalemate. 2) Most wins would occur when one side has enough passed paws such that they chance upon promoting to a few queens.

3) The random-promotion significantly lowers the chances for checkmate. Promotion to a queen is so common that many players who play online chess set paws to automatically promote to queens, so they don't waste the 2 or so seconds it takes to click the "Queen" button.

Post reply on HN