fix compiler warnings
extract board construction

testing on a small board shows that the game does terminate