Question: rust Problem 3 . Omok ( a . k . a . , Gomoku ) Omok is a game played on a Go board with
rust
Problem Omok aka Gomoku
Omok is a game played on a Go board with black and white stones placed alternately. The board has horizontal lines and vertical lines, with the horizontal lines numbered from to from top to bottom, and the vertical lines numbered from to from left to right. In the above figure, if five consecutive stones of the same color are placed, that color wins. "consecutive" means in the horizontal, vertical, or diagonal direction. Thus, the figure shows a case where the black stones have won. However, if six or more stones are placed consecutively, it does not count as a win. Given a state of the Go board as input, write a program to determine whether the black stones have won, the white stones have won, or if the game is still undecided. Note that the input will not include cases where both black and white win simultaneously, or where either color wins in two or more places at the same time.
Input
Each of the lines is represented by numbers, where a black stone is denoted by a white stone by and an empty space is represented by The numbers are displayed with a space between each.
Output
In the first line, print if black wins, if white wins, or if the game is undecided. If black or white wins, print the row and column number of the leftmost stone among the five consecutive stones if the five consecutive stones are placed vertically, print the topmost stone in the second line.
Example
Input
Output
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
