import java.util.Scanner; public class Merlin { static boolean[][] board=new boolean[5][5]; public static void main(String[] args) { Scanner s = new Scanner(System.in); initializeBoard(); scrambleBoard(); displayBoard(); while(!gameOver()) { System.out.println("\nEnter coordinate:"); String guess = s.nextLine(); int c = guess.charAt(0)-65; int r = guess.charAt(1)-49; pick(r, c); displayBoard(); } System.out.println("The lights are all out. You win!"); } //gameOver will return true if there are no lights left on (winning condition) //otherwise it will return false public static boolean gameOver() { return true; } //sets all the spots on the board to false (winning state) public static void initializeBoard() { } // "pick" 10 random spots on the board public static void scrambleBoard() { for(int x =0; x <10; x++) { int r = (int)(Math.random()*5); int c = (int)(Math.random()*5); pick(r, c); } } //for a given spot on the board, board[r][c], "flip" it and all adjacent spots. //make sure you don't try to flip a location that is not on the board. //Ex: Don't try to flip a spot above the top row. public static void pick(int r, int c) { } //simply changes the boolean value of board[r][c] to its opposite public static void flip(int r, int c) { } //shows the board state. True means on and should display "O" //false mean of and displays "-" public static void displayBoard() { } }