- 88
Learning Opportunities
This puzzle can be solved using the following concepts. Practice using these concepts and improve your skills.
Statement
Goal
You are given an Othello board and the colour and position of the next turn. You must answer if it’s legal or not.Othello is a two-player game. Player #1 begins and plays black (
Examples (the played token in lower-case):
*
*
*
*
Each player must play if possible. If not, he passes his turn.
Input
First 8 lines: 8 characters per line, each representing a row of the board. W is a white token, B is a black token, - is an empty cell.
Line 9: The colour of the token, followed by a space, and then the chess-like coordinates of the next move. For example,a1 is the top-left corner while a8 is the bottom-left corner.
Line 9: The colour of the token, followed by a space, and then the chess-like coordinates of the next move. For example,
Output
If the move is legal, print the number of W tokens and of B tokens.
If the cell is already filled by a token, printNOPE .
If the token can’t make a sandwich, printNULL .
If the cell is already filled by a token, print
If the token can’t make a sandwich, print
Constraints
Example
Input
-------- -------- -------- ---WB--- ---BW--- -------- -------- -------- B c4
Output
1 4
A higher resolution is required to access the IDE