服务承诺





51Due提供Essay,Paper,Report,Assignment等学科作业的代写与辅导,同时涵盖Personal Statement,转学申请等留学文书代写。




私人订制你的未来职场 世界名企,高端行业岗位等 在新的起点上实现更高水平的发展




Assignment代写:Gobang Game
2018-03-13 来源: 51due教员组 类别: 更多范文
下面为大家整理一篇优秀的assignment代写范文- Gobang Game,供大家参考学习,这篇论文讨论了如何用c++开发一个五子棋游戏。
Problem Definition
You are going to implement a program that plays Five-in-a-Row (also called Gobang or Gomoku) with a human opponent. Your program should be able to search for the best move so that it ends up winning over a human opponent (or at least make the match very challenging). Towards this end, you should explore the Minimax algorithm and other adversarial search algorithm improvements, like alpha-beta pruning, in order to quickly calculate the program’s next move and eventually win.
Your program should be able to process the following two optional command line arguments:
• -n <size>: We will allow sizes 5*5 to 26*26. If n is not specified, the default value should be 11*11.
• -l: If this option is specified, the human opponent is going to play with the light colors. If the option is not
specified, the human player will be playing with the dark colors. In both cases, the dark players move first.
Once the execution begins, your program should be able to interact with the human player through a command
line interface. The command line interface should support only one command:
• <move>: This command is valid when it is the turn of the human player. <move> indicates the player’s
choice of next move, and should be represented as a <letter><number> pair (without spaces in between)
where the <letter> indicates the column (a, b, c, …) and <number> indicates the row (1, 2, 3, …) of the
board. If the player tries an invalid move the program should just display an error message and prompt the
player for a new move again.
After the human player has specified their move, your program should start calculating its next move and play it.
Then it is the human player’s turn again. During the game, your program should display the board and update it
after every move. Your program should not take more than 30 seconds to decide on its new move. The human
player is allowed as much time as they need for their move.
You will also be provided a ‘referee’ script that will allow for two programs to compete with each other!
Technically, each program will have no knowledge that it plays with another program, they will both think that
they compete with a human. The referee script will be redirecting the moves of each program to the command
line interface of the other program to simulate these human players. Using the referee, you should be able to test
your program with its own self as the opponent. The referee will also enable having a tournament to find which
implementation performs the best, given 30 seconds per move (more information on the tournament soon).
Note: In order to render your program compatible with the referee you need to have an executable binary and
abide by specific output rules. Your program must be compatible with the referee for grading as well.
Executable: If you are writing in C or C++ then you should get a binary by default after compiling (using a
makefile). However, if you choice of language is python or Java then you also need to provide an executable
wrapper script that just executes your code. Name this script “Gobang”. For python you might have the
following simple script:
#!/bin/bash
python Gobang.py $@
and for Java:
#!/bin/bash
java Gobang $@
The above scripts will just execute your python or Java code by simply running the wrapper scripts like this:
./Gobang
These scripts also allow command line arguments which will be directly passed to your code.
Output: In every turn, your program must print the game board using basic ASCII art, followed by the last
played move, followed by whose turn it is (COM vs. human).
At the end, when either player wins or there are no valid moves left, your program should state who won the
match by indicating the color and the nature of the player (human vs. COM). You can check the outputs of the
provided programs to see how your output should look like in order to be compatible with what the referee
script expects. The most important part is that you print a line with the move that was just played, like this:
Move played: a1
51due留学教育原创版权郑重声明:原创assignment代写范文源自编辑创作,未经官方许可,网站谢绝转载。对于侵权行为,未经同意的情况下,51Due有权追究法律责任。主要业务有assignment代写、essay代写、paper代写、cs代写服务。
51due为留学生提供最好的assignment代写服务,亲们可以进入主页了解和获取更多assignment代写范文 提供作业代写服务,详情可以咨询我们的客服QQ:800020041。
