# Visualizing a problem in Chess

So I was interested in this chess puzzle:

In this very peculiar position we have to place the black king to a square such that *it is not in check* and with white being next to move *black gets mated in the maximum number of moves*. That is white takes most moves to mate black.

To solve such a problem, we can take help of our friend Stockfish. Using the online chess website Lichess’s analysis and editor features, we can determine the number of moves to mate for all the available squares.

Doing such an analysis and collecting the data we get the following chart:

Which seems quite interesting and promising as we can then deduce that the *safest* place for the black king is in the *upper right center* of the board. Moreover, we see that the squares near the pieces and the edge of the board have lower values as they are places where the black king gets checkmated quickly.

We can then create a 3D representation of this data by giving the squares the height of the numbers in them. Using some blender magic we get the following in 3D:

Which is quite nice to look at. The 4 squares with value of 8 can be seen to dominate and they are surrounded by squares of gradually decreasing height. The transparency gives the feel of volume, and a look on squares hidden from view.

A bit more playing at blender’s materials and shading we can beautify the image further:

I went ahead and created the white pieces for reference to the problem and we get:

We have this final detailed infographic about the entire thing in one image:

# Extras

A few changes in the cameras location and focus gives us these few spectacular shots:

And now since I have all the pieces created for chess, I setup an entire board with the starting position in blender:

Taking careful look at both the king and the queen, both of them looked out of proportion and awkward. Hence they were modified and we got a new nice setup:

And there is one more angle for the last render:

Here is the imgur album for all the images: https://imgur.com/a/kvxUJW6