Live data from Hacker News

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

chessboardjs.com

31–40 of 131 posts

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

#31
post #27

Some interesting things happen here, the queens almost always seem to go first in my games (perhaps because of their freedom of movement they tend to end up in dangerous territory quickly). Also lots of pawn promotions make the mid-end games a lot more fun, although as the promotion is also random I've ended up with unwinnable endgames (e.g. two knights). I don't play chess beyond knowing the rules, but this is a lot…

I do play chess and found watching this rather painful.

I guess the next thing to do is instead of random: if you can capture a piece of equal or higher value: do so. This is, of course, not a particularly good chess strategy, but would probably be less painful to watch.

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

#32
post #17
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 anyone doesn't capture anything or move a pawn in 50 moves its an draw (better train on that bishop & knight endgame :)... if anyone claims it, so uh, not sure how that counts :) However if an checkmate is impossible with the remaining pieces it's automatic edit: missing pawn from sentence

> if anyone doesn't capture or move anything in 50 moves its an draw

You didn't quite state that right--every move something moves, so it is not possible to go 50 moves without moving anything. :-)

The rule is 50 moves without a pawn moving or anything being captured.

Also, it can be a draw, but it does not have to be. When the last 50 moves have been without a pawn move or a capture, the player on the move can claim a draw if he wishes, but does not have to do so.

Recently, FIDE added a 75 move rule. It is similar to the 50 move rule, except that it is a draw even if both players wish to continue the game. (They also did a similar thing with the 3-fold repetition rule, which like the 50 move rule is only a draw if a player claims it. There is now a 5-fold repetition rule that draws even if neither player wants to claim a draw).

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

#34
post #16
post #11

Earlier quoted context omitted.

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

Pawn wouldn't be stalemate because it can be promoted to a queen. I think it's also possible to checkmate with a rook + king (if you corner the king and have your king cover the escape route from check).

Rook + king is a simple checkmate (http://www.chesscorner.com/tutorial/basic/r_k_mate/r_k_mate....)

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

#36
post #27

Some interesting things happen here, the queens almost always seem to go first in my games (perhaps because of their freedom of movement they tend to end up in dangerous territory quickly). Also lots of pawn promotions make the mid-end games a lot more fun, although as the promotion is also random I've ended up with unwinnable endgames (e.g. two knights). I don't play chess beyond knowing the rules, but this is a lot…

The random move is chosen by generating all legal moves, then choosing from them. This favors pieces with more legal moves, and thus tends to favor the queen the most. Compare with choosing from all pieces that have a legal move, then choosing a legal move for that piece, which would favor a lot of pawn motion, at least until they got themselves killed.

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

#37
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!"

I had exactly the same reaction. I was thinking it was going to be hilarious to watch, but it turned out to be extremely aggravating. The random pawn promotion was particularly egregious.

I'm curious if other people had the same visceral reaction.

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

#40
Never thought this comment would end up on HN when I wrote it ;)

I remember writing this example and being mesmerized watching the games progress. I think I made an alternate version that speed up the time and opened a handful of browser tabs to watch the games. Most of them do end up in insufficient piece draws or the 50-move rule.

Glad to see others are enjoying it :)

Post reply on HN