Lagno
Lagno (also known as Reversi and Othello) is a board game for two players, one black and one white.The board is square, consisting of 8 rows and 8 columns.
In one move, the black player places a black piece into an empty square so that, in at least one of eight directions (up, down, left, right and the four diagonal directions), there is a row of white pieces between the newly placed piece and some other black piece. After placing, all white pieces between (in any direction) the newly placed black piece and pre-existing black pieces become black.Write a program that, for a given board layout, calculates the largest number of white pieces the black player can convert in one move.
........
........
........
...BW...
...WB...
........
........
........Output:
1........
........
...BB...
...B....
..BBW...
..WWW...
....WB..
........Output:
2...B....
...W....
.B.B.B..
..WWW...
.BW.WB..
........
........
........Output:
5Submit solution
Coming laterThe grading service will be connected in a later migration step. You can inspect the task and your previous results now.