Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I am assigned an omok board and the pictures are classes and methods i need. i just need human player and computer player ConsoleUl: responsible

I am assigned an omok board and the pictures are classes and methods i need. i just need human player and computer player
image text in transcribed
image text in transcribed
image text in transcribed
ConsoleUl: responsible for handling user inputs and outputs to the console. - public void displayBoard(Board board): displays the current state of the game board. - public void displayWinner(Board board, Player winner): displays the winner of the game and the winning row. - public void displayDraw(): displays that the game has ended in a draw. - public int getMove(Player player): gets the move from the player. GameController: responsible for managing the game flow and coordinating the players and the board. - public void startGame(): starts the game. - private boolean checkWinningRow(Board board, int row, int col, int deltaRow, int deltaCol): checks if there is a winning row starting from the given position and direction. - private boolean isBoardFull(Board board): checks if the board is full. - private boolean isWinningMove(Board board, int row, int col, Player player): checks if the given move is a winning move. - private boolean isvalidMove(Board board, int row, int col): checks if the given move is valid. - private Player nextPlayer(Player currentPlayer)-gets the next player. - private void playTurn(Board board, Player player): plays a turn for the given player. - private void switchToCheatMode(): switches the game to cheat mode. - private void switchToHumanMode(): switches the game to human mode. - HumanPlayer: represents a human player. - public int getMove(Board board): gets the move from the player. - ComputerPlayer: represents a computer player. - public int getMove(Board board): gets the move from the computer. - Board: represents the game board. - public void placestone(int row, int col, Player player): places a stone on the board for the given player. - public Stone getStone(int row, int col): gets the stone at the given position. - public int getsize(): gets the size of the board. - public boolean isfullo: checks if the board is full. - Stone: represents a stone on the board. - private Player player: the player who owns the stone. - Player: represents a player. - private StoneColor color: the color of the player's stones. - StoneColor: represents the color of a stone (BLACK or WHITE). - GameControllerException: represents an exception that can occur during the game GameMode: an enumeration that represents the two game modes (HUMAN or COMPUTER). Step 6/7 The relationships between the classes are as follows: - ConsoleUI has a dependency on GameController. - GameController has an aggregation relationship with HumanPlayef and ComputerPlayer. - GameController has a composition relationship with Board. - Board has a composition relationship with Stone. - Player has an enumeration relationship with StoneColor

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Issues In Database Management A Refernce For The Thinking Practitioner

Authors: Fabian Pascal

1st Edition

0201485559, 978-0201485554

More Books

Students also viewed these Databases questions

Question

2. What type of team would you recommend?

Answered: 1 week ago