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 nowThis is a popular solution!
Step by stepSolved 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
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
- solve withhh java:- Write the code for the following UML diagram. Input(): Ask user to provide values for color and fuel. Default values for speed is “0” and state is “stopped” addFuel(): Ask user to provide value for fuel to add. Add that value in fuel (attribute) and return value of total fuel. moving(): Ask user to provide the speed of vehicle and fuel Set the value of speed and reduce the fuel (attribute) according to fuel consumption. And also set the state to “Moving”. stop(): This method will display that “Vehicle is stopped” and sets the value of speed to “0” and state to “Stopped” display(): This method will display the attributes value to output like: “Vehicle is stopped. It has red color. It’s speed is 0.0 and fuel is 2.5 Liter”arrow_forwardJAVA A popular technique used with GUI programs is a programming design called Model-View-Controller. This is a programming technique where you split your program up into three distinct portions - the model, view, and controller - and have each portion handle a single, separate function of the program. Model-View-Controller is not built in to any programming language, but is rather a method programmers use when designing their programs. The model handles the program's data. Whether it is a series of variables, some files, or a database, the model is responsible for managing and retrieving the data. The view, controller, and user never see or interact with the data directly; it all goes through the model. The view handles the presentation of the data. This would be the GUI design in a graphical program. The view does not retrieve the data, handle errors with the data, or manage user requests. The view's only purpose is to construct the visuals for whatever data is passed to it,…arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education