Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Othello.java Othello.txt Othello, also known as Reversi, is a game based on the older ancient game of Go, but significantly simplified. You will be writing
Othello.java Othello.txt Othello, also known as Reversi, is a game based on the older ancient game of Go, but significantly simplified. You will be writing an Othello simulation. You will be given the state of the game board which is an eight by eight 2D Character array. Each element of the array will hole the character 'E' (empty), 'B' (black), or 'W' (white). The black and white players take turns placing one of their peice on the board. We are not going to worry about how the piecess are placed, instead we will consider the result of placing the piece on the board. From the position of where the chip is placed on the board, the player looks in the eight cardinal directions: north, northeast, east, southeast, south, southwest, west, and northwest. On each of these lines, starting at the piece placement, if there is another piece of the same color (let's call it the ending piece) then all the opponents pieces between the starting piece and the ending piece become the same color as the starting piece. Each of the cardinal directions get a chance at changing these pieces, always starting from the starting piece. You will be given a textfile called Othello.txt. In that file, you will be given the status of the board first. It will always be and eight by eight board. You will print out the initial state of the board. You will then receive an unknown number of coordinates and colors, this is each move and the color piece being laid down. Each move should produce an output. Once every move is completed, you should count the number of white pieces and the number of black pieces and print out who won. Sample text file EEEEEEEE EEEEEEEE EEEBWEEE EEEWBEEE EEE EEEE EEEEEEEE EEEEEEEE 5 4 W 3 2 B 24 W 3 5 B 6 4 W 6 5 B 7 4 W EEEE EEEEE EEEEEEET EEEBWEEE EEEWBEEE EEEEEEEE EEEEEEEE EEEEEEEE Move 5,4:W EEEEEEEE EE EEEEEEEE EEEBWEEE EEEWWEEE EEEEWEEE EEEEEEEE EEEEEEEE Move 3,2:B EEEEEEEE EEEEEEEE EEEEEEEE EEBBWEEE EEEWWEEE EEEEWEEE EEEEEEEE EEEEEEEE Move 2,4:W EEEEEEEE EEEEEEEE EEEEE EE EEEEEEEE EEBBWEEE EEEWWEEE EEEEWEEE EEEEEEEE EEEEEEEE Move 2,4:W EEEEEEEE EEEEEEEE EEEEWEEE EEBBWEEE EEEWWEEE EEEEWEEE EEEEEEEE EEEEEEEE Move 3,5:B EEEEEEEE EEEEEEEE EEEEWEEE EEBBBBEE EEEWWEEE EEEEWEEE EEEEEEEE EEEEEEEE Move 6,4:W EEEEEEEE EEEEEEEE EEEEWEEE EEBBBBEE EEEWWEEE EEEEWEEE EEEEWEEE EEEEEEEE Move 6,5:B EEEEEEEE EEEEEEEE EEEEWEEE EEBBBBEE EEEBWEEE EEEEBEEE EEEEWBEE EEEEEEEE EEEBWEEE EEEEBEEE EEEEWBEE EEEEEEEE Move 7, 4:W EEEEEEEE EEEEEEEE EEEEWEEE EEBBBBEE EEEBWEEE EEEEBEEE EEEEWBEE EEEEWEEE BLACK WINS 7 to 4
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started