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
Why am I being blocked from accessing chat got??
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
write on research question project topic modelling and simulation of the spread of saars-cov-2 disease with latent