Answers.Body: <p>TLDR: The best we can claim is that the number of moves for black to force a win is bounded by the number of moves for black to force a win in a regular game of chess, a number that we don't know.</p>
  <hr />
  <p>Consider the following position:</p>
  <pre><code>[FEN &quot;8/1k5R/R7/1K6/8/8/8/8 - - - 0 1&quot;]
  </code></pre>
  <p>We can then specify a winning solution for white like so.</p>
  <ol start="2">
  <li>rg6</li>
  <li>rg8#</li>
  </ol>
  <p>However, we can use this example to show that in order for white to have a winning strategy in this game, they must have a winning strategy for chess itself. To do so, let's consider how the solution above was generated.</p>
  <p>We first consider all the possible moves for black. In this scenario, those are 1 ... kb8 and 1 ... kc8.</p>
  <p>Since the problem doesn't provide us a way to conditionally specify a move other than determining whether the move is valid, we must specify a strategy that is winning regardless of what black plays in a situation.</p>
  <p>Regardless of which move black chooses, 2 rg6 will be a valid move, thus we progress to a scenario where black's king is son the 8th rank and white has two rooks on the 7th. Neither can be reached by the king before being checkmated. On this turn, black can either play, 2 ... ka8 or 2 ... kc8 if they played 1 ... kb8; or they can play 2 ... kb8 or 2 ... kd8 if they played 1 ... kc8. We can picture this move set as a decision tree (this will be helpful when we go to generalize this situation). Regardless of what black plays on either of their turns, 3 rg8# is innevitable.</p>
  <p>How did white select these moves? That's the natural question to ask, and we can build on our concept of a decision tree to do it. After each move by black we can envision a similar decision being made by white. Enumerating all of whites possible moves would be much more verbose, but certainly possible [1]. In each of these positions, we would then evaluate the position as white to determine if it led to a further winning strategy for white. We make a move if, regardless of what black does, there is a forced mate for white. This is the well known <a href="https://en.wikipedia.org/wiki/Minimax" rel="nofollow noreferrer">Minimax algorithm</a>.</p>
  <hr />
  <p>Call the position above <em>P(n)</em> where <em>n</em> is the move number of the game ending in this position. <em>P(n+1)</em> would be the position following this, as we've described above, and <em>P(n+2)</em> is checkmate.</p>
  <p>Now let's talk about the answer to the question itself, <em>P(0)</em>, also known as the start of a game of chess. There are 12 possible moves black could play on move 1. All of them are valid regardless of what move white made, and white must consider all of them at once to make their next move.</p>
  <p>If for instance the game began 1 e4 d5, the move set specified by white on turn two could include 2 exd5 d4. We could also read this as, if black plays the Scandinavian defense, white plays the Scandinavian closed. Otherwise, white plays d4.</p>
  <p>On each turn, white must enumerate all possible moves after all possible moves by black from the current position <em>P(t)</em> for some turn <em>t</em> otherwise they will lose. A sensible way to order these could be defined as the minimax sorting by number of moves until forced checkmate, and this is a more restricted problem to providing a minimax solution to chess itself. <strong>Therefore, the best we can claim is that the number of moves for black to force a win is bounded by the number of moves for black to force a win in a regular game of chess, a number that we don't know.</strong></p>
  <p>To answer the other two questions, since white must plan for all possible moves from black in order to avoid losing, there cannot be any unique strategies for black since that strategy would, by the definition of how white selects a strategy, be considered by white. Assuming black can see the move list ahead of time, they would simply see the strategies white attempts to employ for whatever they play (such as seeing their decision to play the closed Scandinavian presented above). If black is making optimal moves anyways, I think this is unlikely to affect their performance, however if the white player is playing at their skill level, they may be able to find a weakness in their play just as they would in a standard game of chess.</p>
  <p>[1]: The rook on h7 would be able to move to any square on the h-file or 7th rank, the rook on a6 could move to any square on the a-file or the 6th rank, and the king could move to any of the surrounding squares except a6.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-12-21T21:46:06.847Z
Answers.LastActivityDate: 2021-12-21T22:55:38.467Z
Answers.LastEditDate: 2021-12-21T22:55:38.467Z
Answers.UserDisplayName: Andey Robins
Body: <p>In this scenario:</p>
  <p>Black plays normally (and optimally).</p>
  <p>White has prepared a long list of possible moves for each turn before the game starts, then movement is automatic. Each turn, each move for that turn is checked in order, and if it is legal, it is played (and the rest of the possible moves for that turn are discarded).</p>
  <p>(White needs to unambiguously specify the piece type they are moving, and whether it is a capture or not, and what they are promoting to, if anything. They don't need to indicate whether they are checking.)</p>
  <p>For instance, let's say white prepares:</p>
  <ol>
  <li>e4</li>
  <li>exd5 e5 Nc3</li>
  </ol>
  <p>If black plays 1..d5, white captures. If black plays 1..e5, white plays Nc3. Otherwise, white plays e5.</p>
  <p>(If white ever has no legal, unambiguous move prepared, they lose.)</p>
  <p>Question: what is the longest number of moves white could avoid losing, in this scenario? (I'm assuming Black can force a win)</p>
  <p>I imagine it may be very difficult to compute exactly, but I'm interested in estimates etc.</p>
  <p>Assuming that black cannot see white's move list ahead of time, are there any interesting strategies black should employ?</p>
  <p>Assuming that black <em>can</em> see white's move list ahead of time, how does that change the main answer?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-10-28T08:04:51.263Z
Comments.Text: If Black can see the move list, all they have to do is preparing a specific sequence so the game is probably going to be short
Comments.UserDisplayName: David
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-10-28T09:06:00.193Z
Comments.Text: Interesting. This will be very hard to compute and I suppose the right way to tackle this is to consider Black's strategy, maybe finding a line where White really needs to play move A and not B and another line where White needs B and not A. White's list of moves has to be exhaustive of course (including Kxf2, Kxe2, Kxd2 at the end of the list at move 4, for instance). My bet is that White survives more than 20 moves, but no more than 30.
Comments.UserDisplayName: Evargalo
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-10-28T09:08:52.503Z
Comments.Text: Btw, I suppose White is not allowed to specify which piece they are capturing ? e.g. on move 3, a list like "Bf1xRa6, Be2, Bf1xNa6, Nf3, Bf1xPa6" is not an option ?
Comments.UserDisplayName: Evargalo
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-10-28T09:18:47.707Z
Comments.Text: Related but not duplicate: https://chess.stackexchange.com/questions/24961/from-the-start-of-the-game-what-is-the-longest-possible-series-of-consecutive-wh
Comments.UserDisplayName: D M
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-10-28T10:16:07.627Z
Comments.Text: Interesting. Seeing as White may include every possible White move in the nth move's list, Black's only way to win is to checkmate or stalemate. This list of every possible White move might, for instance, start with all those with an x, so that White always captures if possible unless White has indicated a specific move that takes precedence.
Comments.UserDisplayName: Rosie F
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-10-28T11:43:37.767Z
Comments.Text: @rosie yes, losing by failing to provide a move is not really relevant to the actual question, I just included it for completeness.
Comments.UserDisplayName: Steve Bennett
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-10-28T11:44:05.623Z
Comments.Text: @evergalo correct.
Comments.UserDisplayName: Steve Bennett
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-10-28T11:45:31.217Z
Comments.Text: Huh, I just thought of another variation of this where both players follow White's rules. That could actually be an interesting battle.
Comments.UserDisplayName: Steve Bennett
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-10-28T18:36:50.607Z
Comments.Text: Well, *in theory*, White can explore the entire game tree and write out all the possible non-losing replies (obviously, that would be impractical in real life, however). Black could respond to that by trying to force the game into a situation where White's moves can ambiguously match more than one game state, and where the same move wins in one game state but loses in another. I'm pretty sure Black can eventually do that, even if Black cannot actually see White's move sheet, but it should take quite a few plies to get there.
Comments.UserDisplayName: Kevin
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-10-28T20:52:03.313Z
Comments.Text: If both players are required to do this, you might be interested in this: [https://codegolf.stackexchange.com/questions/195032/totally-blind-chess](https://codegolf.stackexchange.com/questions/195032/totally-blind-chess)
Comments.UserDisplayName: Spitemaster
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-10-28T23:36:56.333Z
Comments.Text: Thanks @Spitemaster, super interesting! Similar concept, but the players don't know what turn their move is being played on.
Comments.UserDisplayName: Steve Bennett
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-10-29T07:42:16.170Z
Comments.Text: @SteveBennett: It would be fun to approach this question experimentally: The list of unique moves White may specify is long, but not that long: 64*6*2+promotion cases. The list of possible White strategies is the ! of this number, i.e. astronomic. (Interesting follow-up: Is leaving out a certain White move from the strategy always dominated?) Nevertheless, implementing a random pick of these strategies is easily implemented in a chess engine. I think White's nonrandom best idea is keeping the vicinity of the king clear and try all the Xxe2/f2/d2 moves first.
Comments.UserDisplayName: Hauke Reddmann
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-10-29T07:45:39.783Z
Comments.Text: On the other hand, Black should "go for the throat" (regardless if Black knows the White move ranking list or not). White can't prepare for everything...
Comments.UserDisplayName: Hauke Reddmann
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-10-29T07:58:37.053Z
Comments.Text: Now that I reread it, White can alter the list order for any move, but this is only a factor of 20 or so (I severely doubt White can last longer) of different lists, and could still be very easily implemented into a chess engine.
Comments.UserDisplayName: Hauke Reddmann
Tags: <puzzles>
Title: How long could a player last with all their possible moves written out in advance?
ThreadText: # How long could a player last with all their possible moves written out in advance?
  
  (Asked by: username_0 on 2021-10-28)
  
  In this scenario:
  
  Black plays normally (and optimally).
  
  White has prepared a long list of possible moves for each turn before the game starts, then movement is automatic. Each turn, each move for that turn is checked in order, and if it is legal, it is played (and the rest of the possible moves for that turn are discarded).
  
  (White needs to unambiguously specify the piece type they are moving, and whether it is a capture or not, and what they are promoting to, if anything. They don't need to indicate whether they are checking.)
  
  For instance, let's say white prepares:
  
  1. e4
  2. exd5 e5 Nc3
  
  If black plays 1..d5, white captures. If black plays 1..e5, white plays Nc3. Otherwise, white plays e5.
  
  (If white ever has no legal, unambiguous move prepared, they lose.)
  
  Question: what is the longest number of moves white could avoid losing, in this scenario? (I'm assuming Black can force a win)
  
  I imagine it may be very difficult to compute exactly, but I'm interested in estimates etc.
  
  Assuming that black cannot see white's move list ahead of time, are there any interesting strategies black should employ?
  
  Assuming that black *can* see white's move list ahead of time, how does that change the main answer?
  
  **Tags:** puzzles
  
  > **Comments:**
  > **username_1**: If Black can see the move list, all they have to do is preparing a specific sequence so the game is probably going to be short  
  > **username_2**: Interesting. This will be very hard to compute and I suppose the right way to tackle this is to consider Black's strategy, maybe finding a line where White really needs to play move A and not B and another line where White needs B and not A. White's list of moves has to be exhaustive of course (including Kxf2, Kxe2, Kxd2 at the end of the list at move 4, for instance). My bet is that White survives more than 20 moves, but no more than 30.  
  > **username_2**: Btw, I suppose White is not allowed to specify which piece they are capturing ? e.g. on move 3, a list like "Bf1xRa6, Be2, Bf1xNa6, Nf3, Bf1xPa6" is not an option ?  
  > **username_3**: Related but not duplicate: https://chess.stackexchange.com/questions/24961/from-the-start-of-the-game-what-is-the-longest-possible-series-of-consecutive-wh  
  > **username_4**: Interesting. Seeing as White may include every possible White move in the nth move's list, Black's only way to win is to checkmate or stalemate. This list of every possible White move might, for instance, start with all those with an x, so that White always captures if possible unless White has indicated a specific move that takes precedence.  
  > **username_0**: @rosie yes, losing by failing to provide a move is not really relevant to the actual question, I just included it for completeness.  
  > **username_0**: @evergalo correct.  
  > **username_0**: Huh, I just thought of another variation of this where both players follow White's rules. That could actually be an interesting battle.  
  > **username_5**: Well, *in theory*, White can explore the entire game tree and write out all the possible non-losing replies (obviously, that would be impractical in real life, however). Black could respond to that by trying to force the game into a situation where White's moves can ambiguously match more than one game state, and where the same move wins in one game state but loses in another. I'm pretty sure Black can eventually do that, even if Black cannot actually see White's move sheet, but it should take quite a few plies to get there.  
  > **username_6**: If both players are required to do this, you might be interested in this: [https://codegolf.stackexchange.com/questions/195032/totally-blind-chess](https://codegolf.stackexchange.com/questions/195032/totally-blind-chess)  
  > **username_0**: Thanks @username_6, super interesting! Similar concept, but the players don't know what turn their move is being played on.  
  > **username_7**: @SteveBennett: It would be fun to approach this question experimentally: The list of unique moves White may specify is long, but not that long: 64*6*2+promotion cases. The list of possible White strategies is the ! of this number, i.e. astronomic. (Interesting follow-up: Is leaving out a certain White move from the strategy always dominated?) Nevertheless, implementing a random pick of these strategies is easily implemented in a chess engine. I think White's nonrandom best idea is keeping the vicinity of the king clear and try all the Xxe2/f2/d2 moves first.  
  > **username_7**: On the other hand, Black should "go for the throat" (regardless if Black knows the White move ranking list or not). White can't prepare for everything...  
  > **username_7**: Now that I reread it, White can alter the list order for any move, but this is only a factor of 20 or so (I severely doubt White can last longer) of different lists, and could still be very easily implemented into a chess engine.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_8 on 2021-12-21. Score: 4
  
  TLDR: The best we can claim is that the number of moves for black to force a win is bounded by the number of moves for black to force a win in a regular game of chess, a number that we don't know.
  
  Consider the following position:
  [FEN "8/1k5R/R7/1K6/8/8/8/8 - - - 0 1"]
  
  We can then specify a winning solution for white like so.
  
  rg6
  rg8#
  
  However, we can use this example to show that in order for white to have a winning strategy in this game, they must have a winning strategy for chess itself. To do so, let's consider how the solution above was generated.
  We first consider all the possible moves for black. In this scenario, those are 1 ... kb8 and 1 ... kc8.
  Since the problem doesn't provide us a way to conditionally specify a move other than determining whether the move is valid, we must specify a strategy that is winning regardless of what black plays in a situation.
  Regardless of which move black chooses, 2 rg6 will be a valid move, thus we progress to a scenario where black's king is son the 8th rank and white has two rooks on the 7th. Neither can be reached by the king before being checkmated. On this turn, black can either play, 2 ... ka8 or 2 ... kc8 if they played 1 ... kb8; or they can play 2 ... kb8 or 2 ... kd8 if they played 1 ... kc8. We can picture this move set as a decision tree (this will be helpful when we go to generalize this situation). Regardless of what black plays on either of their turns, 3 rg8# is innevitable.
  How did white select these moves? That's the natural question to ask, and we can build on our concept of a decision tree to do it. After each move by black we can envision a similar decision being made by white. Enumerating all of whites possible moves would be much more verbose, but certainly possible [1]. In each of these positions, we would then evaluate the position as white to determine if it led to a further winning strategy for white. We make a move if, regardless of what black does, there is a forced mate for white. This is the well known Minimax algorithm.
  
  Call the position above P(n) where n is the move number of the game ending in this position. P(n+1) would be the position following this, as we've described above, and P(n+2) is checkmate.
  Now let's talk about the answer to the question itself, P(0), also known as the start of a game of chess. There are 12 possible moves black could play on move 1. All of them are valid regardless of what move white made, and white must consider all of them at once to make their next move.
  If for instance the game began 1 e4 d5, the move set specified by white on turn two could include 2 exd5 d4. We could also read this as, if black plays the Scandinavian defense, white plays the Scandinavian closed. Otherwise, white plays d4.
  On each turn, white must enumerate all possible moves after all possible moves by black from the current position P(t) for some turn t otherwise they will lose. A sensible way to order these could be defined as the minimax sorting by number of moves until forced checkmate, and this is a more restricted problem to providing a minimax solution to chess itself. Therefore, the best we can claim is that the number of moves for black to force a win is bounded by the number of moves for black to force a win in a regular game of chess, a number that we don't know.
  To answer the other two questions, since white must plan for all possible moves from black in order to avoid losing, there cannot be any unique strategies for black since that strategy would, by the definition of how white selects a strategy, be considered by white. Assuming black can see the move list ahead of time, they would simply see the strategies white attempts to employ for whatever they play (such as seeing their decision to play the closed Scandinavian presented above). If black is making optimal moves anyways, I think this is unlikely to affect their performance, however if the white player is playing at their skill level, they may be able to find a weakness in their play just as they would in a standard game of chess.
  [1]: The rook on h7 would be able to move to any square on the h-file or 7th rank, the rook on a6 could move to any square on the a-file or the 6th rank, and the king could move to any of the surrounding squares except a6.
  
  
  ---
  
  