View the step-by-step solution to:

Question requirements:

Question requirements: Two players must be able to play a game using your java program, and the game must play according to the rules of Tic Tac Toe (3x3 grid, turns alternate, first player to mark three spaces in the same row, column, or diagonal wins, a space can only be marked once).

User interface requirements: A command-line interface should be used for input and output. The user interface should: Display the board after every move, prompt user input, announce win/loss/tie at end of game, and display error messages when illegal moves are made.

Internal requirements: For reusability of code, separate the program into multiple classes.
You will need a GameDisplay class to display the board, prompt user input, and return error messages. No other class may output to the command line outside debugging.
You will need a GameController class to read in user input. No other class may accept inputs.
You will need a GameModel class to keep track of the game's state and check any rules.
Between these three classes, GameController will ask GameDisplay to prompt the user for input, and verify legality of moves with GameModel. After a valid move is made, GameModel should ask GameDisplay to display the board.
Sign up to view the entire interaction

Top Answer

Dear Student, We have reviewed your assignment thoroughly based on details of your assignment... View the full answer

Sign up to view the full answer

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.


Educational Resources
  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question
Ask a homework question - tutors are online