Design AI for Playing Gomoku desciption and figure from wikipedia (https://en.uikipedia.org/uiki/Gomoku) Gomoku: Gomoku, also called Five in a Row, is an abstract strategy board game. It is traditionally played with Go pieces (black and white stones) on a Go board. It is played using a 15x15 board while in the past a 19x19 board was standard. Because pieces are typically not moved or removed from the board, gomoku may also be played as a paper-and-pencil game. The game is known in several countries under different names. several countries under different names. Rule: Players alternate turns placing a stone of their color on an empty intersection.Black plays first. The winner is the first player to form an unbroken chain of five stones horizontally, vertically, or diagonally.Placing so that a line of more than five stones of the same color is created does not result in a win. These are called overlines. Task: Your task is to implement the following functions in C/C++: 1. int checkBoardStatus(intboard[15][15]):return 0 if no one wins; return 1 if black wins; return 2 if white wins. 2. void play(int board[15] [15],int color, int position[2]):play a pebble with color at the board (position[0],position[1]). Let's as- sume that black-1 and white-2 for consistency.Let's further assume board[i][j]=0 if position (i, j) is available for playing a pebble; board[i][j]=1 if position (i, j) has a black pebble; board[i][j]-2 if position (i,j) has a white pebble. 3. void search(intboard[15] [15],int color, int position[2]): search the best position for the given color and return it in the position array. You are recommended to use the Monte Carlo Tree Search algorithm to find the best possible position. 4.void display(int board[15][15]):display the current status of the board. 5. int main(): main function which takes human input from keyboard and play with the AIyou designed.
Design
desciption and figure from wikipedia (https://en.uikipedia.org/uiki/Gomoku)
Gomoku: Gomoku, also called Five in a Row, is an abstract strategy board game. It is traditionally played with Go pieces (black and white stones) on a Go board. It is played using a 15x15 board while in the past a 19x19 board was standard. Because pieces are typically not moved or removed from the board, gomoku may also be played as a paper-and-pencil game. The game is known in several countries under different names.
several countries under different names.
Rule: Players alternate turns placing a stone of their color on an empty intersection.Black plays first. The winner is the first player to form an unbroken chain of five stones horizontally, vertically, or diagonally.Placing so that a line of more than five stones of the same color is created does not result in a win. These are called overlines.
Task: Your task is to implement the following functions in C/C++:
1. int checkBoardStatus(intboard[15][15]):return 0 if no one wins;
return 1 if black wins; return 2 if white wins.
2. void play(int board[15] [15],int color, int position[2]):play
a pebble with color at the board (position[0],position[1]). Let's as- sume that black-1 and white-2 for consistency.Let's further assume board[i][j]=0 if position (i, j) is available for playing a pebble; board[i][j]=1 if position (i, j) has a black pebble; board[i][j]-2 if position (i,j) has a white pebble.
3. void search(intboard[15] [15],int color, int position[2]): search
the best position for the given color and return it in the position array. You are recommended to use the Monte Carlo Tree Search
4.void display(int board[15][15]):display the current status of the
board.
5. int main(): main function which takes human input from keyboard and
play with the AIyou designed.
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 1 images
Please provide answers to the following questions based on the previous code(JAVASCRIPT):
-
What are the weaknesses or limitations of the current implementation?
-
Does the current implementation utilize the Monte Carlo Tree Search (MCTS)
algorithm ? If not, please describe the algorithm used for the implementation. -
What are the expectations or objectives of the current implementation in terms of performance and functionality?
Please I want to the same code to be implemented in javascript. Please make sure its encoding is UTF-8 and the input and output should be in JSON