![]() ![]() ![]() According to the rules, the game begins with four discs on the board: two white and two black, arranged on the four center cells of the grid, with the two white discs separated diagonally and the two black discs separated diagonally. The fourth line specifies the arrangement of the cells on the board when the game starts. The third line specifies which of the players will move first: B for black, W for white. The second line specifies the number of columns on the board, which will be an even integer between 4 and 16 (inclusive) and does not have to be the same as the number of rows. The first line specifies the number of rows on the board, which will be an even integer between 4 and 16 (inclusive). Your program then reads five lines of input, specifying the options that will be used to determine how the game will be played. (See the section titled Simplified Othello rules below for a description of the simplified set of rules, which you can implement for partial credit if you’re unable to complete the full rules.) Your program begins by printing a line of output specifying which of the two sets of Othello rules are supported by your program, by printing either FULL or SIMPLE. You can freely assume that the input will match the specification described we will not be testing your program on any inputs that don’t match the specification. So it is vital that your program reads inputs and writes outputs precisely as specified below. ![]() The intent here is not to write a user-friendly user interface what you’re actually doing is building a tool for testing your game logic, which we’ll then be using to automatically test your game logic. A detailed look at how your program should behave Your program will take its input via the console, printing no prompts to a user. When you’re finished, you’ll have the game logic that will form the basis of your completed version of Othello in the next project. The program begins by reading input that selects these options the game is then played by requiring input directly into the console that specifies a player’s next move, continuing until the game is complete, at which point the program ends. There are a handful of options that allow you to specify, before the game begins, how the game will be played. Using your test program, you’ll be capable of playing a single game of Othello on a single computer. Spacing, capitalization, and other seemingly-minor details are critical. The program This project asks you to implement the game logic of Othello, along with a console-mode program with a very spartan user interface that you’ll use to test it - and that we’ll use to automatically test it, making it crucial that you get the format of the program’s input and output right according to the specification below. If you want to try playing the game, a web-based version of it is available. If you haven’t played Othello before, or have seen it previously but don’t remember how it works, you should at least read the sections of the Wikipedia entry that cover the rules of the game knowing how the game is played before proceeding with this project is vital. The rules of the game, along with some notion of strategy, are described in the Wikipedia entry on Reversi. ![]() The game concludes when every square on the grid contains a disc, or when neither player is able to make a legal move the winning player is generally the one who has more discs on the board at the end of the game, though there are alternate ways to determine a winner. When discs are placed on the game board, other discs already on the board are flipped (i.e., a black disc becomes a white disc or vice versa). Players alternately place discs on the game board one player’s discs are black and the other player’s are white. The game is played on a rectangular board divided into a grid - usually 8×8, though the size of the grid can vary. Othello (also known as Reversi) is a well-known two-player strategy game. This project and the subsequent one will ask you to implement a game called Othello. ![]()
0 Comments
Leave a Reply. |