Pseudo Code Chess [closed]

1

I was given a challenge to resolve through pseudocode:

A chess board with only the King and Queen. What is the minimum and maximum number of plays to checkmate the King?

Black King, White Queen

I know the rules of chess and have played a few times, from there until I say that I know how to play chess, goes a long way.

    
asked by anonymous 28.10.2015 / 17:25

1 answer

14

As the question is posed, there is not enough information to solve the problem. But assuming the following:

  • They are not only a king and a queen (of opposite colors), but a king of one color and a pair (king + queen) of the other color
  • To simplify the explanation below, assuming there is a black king (K), and a king (k) and a white queen (q)

The minimum number of plays is zero - if the initial board configuration is already in a checkmate state. For example (instead of black):

/-------------------------------\
|   |   |   |   | K |   |   | q |
|-------------------------------|
|   |   |   |   |   |   |   |   |
|-------------------------------|
|   |   |   |   | k |   |   |   |
|-------------------------------|
|   |   |   |   |   |   |   |   |
|-------------------------------|
|   |   |   |   |   |   |   |   |
|-------------------------------|
|   |   |   |   |   |   |   |   |
|-------------------------------|
|   |   |   |   |   |   |   |   |
|-------------------------------|
|   |   |   |   |   |   |   |   |
\-------------------------------/

Or one, if it's a move before that.

The maximum number will depend on the strategy the player of the white pieces is using to corner the black king. If the player has no strategy and moves the pieces randomly, the maximum number may tend to infinity.

There are some end-of-game strategies for this scenario (K vs k + q). If the player has one of them (for example, link ), the number maximum will depend on where the three pieces are initially on the board - as the white king needs to get "close" to the black, if he is further away the number of moves will be greater. But at most, the number of plays before checkmate will be 10 .

    
28.10.2015 / 17:59