Login with google an password

How can I plan south india tamilnadu,karnataka,and
madras tour

public class Game {
// The game board and the game status
public static String board = {β€œ0”, β€œ1”, β€œ2”, β€œ3”, β€œ4”, β€œ5”, β€œ6”, β€œ7”, β€œ8”};
public static int currentState; // the current state of the game
public static String currentPlayer; // the current player

public static Scanner input = new Scanner(System.in); // the input Scanner

/** The entry main method (the program starts here) */
public static void main(String args) {
// Initialize the game-board and current status
initGame();
printBoard();
do {
getHumanSpot();
if (!gameIsOver() && !tie()) {
evalBoard();
}
} while (!gameIsOver() && !tie()); // repeat if not game-over
System.out.print(β€œGame over\n”);
}

/** Initializes the game */
public static void initGame() {
currentState = 0; // β€œplaying” or ready to play
currentPlayer = β€œX”; // cross plays first
}

public static String nextPlayer() {
if (currentPlayer == β€œX”) {
return β€œO”;
} else {
return β€œX”;
}
}

/** Update global variables β€œboard” and β€œcurrentPlayer”. */
public static void getHumanSpot() {
boolean validInput = false; // for input validation
System.out.print(β€œEnter [0-8]:\n”);
do {
int spot = input.nextInt();
if (board[spot] != β€œX” && board[spot] != β€œO”) {
board[spot] = β€œX”; // update game-board content
printBoard();
validInput = true; // input okay, exit loop
}
currentPlayer = nextPlayer(); // cross plays first
} while (!validInput); // repeat until input is valid
}

public static void evalBoard() {
boolean foundSpot = false;
do {
if (board[4] == β€œ4”) {
board[4] = β€œO”;
foundSpot = true;
} else {
int spot = getBestMove();
if (board[spot] != β€œX” && board[spot] != β€œO”) {
foundSpot = true;
board[spot] = β€œO”;
} else {
foundSpot = false;
}
}
} while (!foundSpot);
printBoard();
}

/** Return true if the game was just won */
public static boolean gameIsOver() {
return board[0] == board[1] && board[1] == board[2] ||
board[3] == board[4] && board[4] == board[5] ||
board[6] == board[7] && board[7] == board[8] ||
board[0] == board[3] && board[3] == board[6] ||
board[1] == board[4] && board[4] == board[7] ||
board[2] == board[5] && board[5] == board[8] ||
board[0] == board[4] && board[4] == board[8] ||
board[2] == board[4] && board[4] == board[6];
}

public static int getBestMove() {
ArrayList availableSpaces = new ArrayList();
boolean foundBestMove = false;
int spot = 100;
for (String s: board) {
if (s != β€œX” && s != β€œO”) {
availableSpaces.add(s);
}
}
for (String as: availableSpaces) {
spot = Integer.parseInt(as);
board[spot] = β€œO”;
if (gameIsOver()) {
foundBestMove = true;
board[spot] = as;
return spot;
} else {
board[spot] = β€œX”;
if (gameIsOver()) {
foundBestMove = true;
board[spot] = as;
return spot;
} else {
board[spot] = as;
}
}
}
if (foundBestMove) {
return spot;
} else {
int n = ThreadLocalRandom.current().nextInt(0, availableSpaces.size());
return Integer.parseInt(availableSpaces.get(n));
}
}

/** Return true if it is a draw (no more empty cell) */
// TODO: maybe there is an easeir way to check this
public static boolean tie() {
return board[0] != β€œ0” &&
board[1] != β€œ1” &&
board[2] != β€œ2” &&
board[3] != β€œ3” &&
board[4] != β€œ4” &&
board[5] != β€œ5” &&
board[6] != β€œ6” &&
board[7] != β€œ7” &&
board[8] != β€œ8”;
}

/** Print the game board */
public static void printBoard() {
System.out.println(" " + board[0] + " | " + board[1] + " | " + board[2] + β€œ\n===+===+===\n” + " " + board[3] + " | " + board[4] + " | " + board[5] + β€œ\n===+===+===\n” + " " + board[6] + " | " + board[7] + " | " + board[8] + β€œ\n”); // print all the board cells
}

}
class daigram of this code

1 Like

Why am I being blocked from accessing chat got??

1 Like

disclosing the experience og teachers during pandemic in Turkey

Hlo i wantb the info about the present situation .challenge ang opportunity of sports in nepal

1 Like

write on research question project topic modelling and simulation of the spread of saars-cov-2 disease with latent

1 Like