Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

TicTacToeGame.java package tictactoegame; public class TicTacToeGame static int [ ] [ ] gameboard; static final int EMPTY = 0 ; static final int NOUGHT =

TicTacToeGame.java
package tictactoegame;
public class TicTacToeGame
static int[][] gameboard;
static final int EMPTY =0;
static final int NOUGHT =-1;
static final int CROSS =1;
1** Set a square on the board must be empty */
static void set (int val, int row, int col)
throws IllegalArgumentException {
if (gameboard[row][ Col EMPTY)
gameboard[row][col]= val;
else throw new IllegalArgumentException
("Player already there!");
}
??*** display the board */
static void displayBoard(){
for ( int r=0;r gameboard.length; r++){
System.out.print ("|");
for (int c=0;c gameboard r. length; c++)
{
switch (gameboard [r][c]){
case NOUGHT:
System.out.print("O wins");
nnosk.
Console
Error: Main method not found in class tictactoegame.TicTacToeGame, please define the main method as:
public static void main(String[] args)
or a JavaFX application class must extend javafx.application.Application
image text in transcribed

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

Pro SQL Server Administration

Authors: Peter Carter

1st Edition

1484207106, 9781484207109

More Books

Students also viewed these Databases questions

Question

What laws were probably being violated?

Answered: 1 week ago