Question: Java Programming import java.util.Random; import java.util.Scanner; //Main Class public class MazeBurrowing { public static void main(String[] args) { // TODO Auto-generated method stub Scanner kb
Java Programming

![public static void main(String[] args) { // TODO Auto-generated method stub Scanner](https://s3.amazonaws.com/si.experts.images/answers/2024/09/66dcd0d30c85d_41066dcd0d287145.jpg)
import java.util.Random; import java.util.Scanner; //Main Class public class MazeBurrowing { public static void main(String[] args) { // TODO Auto-generated method stub Scanner kb = new Scanner(System.in); System.out.println("How high would you like the maze to be? (Even numbers will be converted to odd)"); int y = kb.nextInt(); System.out.println("How width would you like the maze to be? (Even numbers will be converted to odd)"); int x = kb.nextInt(); //Make sure the sizes are not negative y = Math.abs(y); x = Math.abs(x); //and make sure they are odd values if(y%2 == 0) y++; if(x%2 == 0) x++; //Create the grid char [][] grid = new char[x][y]; MazeGenerator.generateMaze(grid,1,1); //Print the grid to a textfile or "" to print to screen MazeGenerator.printMatrix(grid,"Maze.txt"); System.out.println("Done!"); } }
//Maze Generator Class
import java.io.PrintWriter; import java.util.Random; public class MazeGenerator { private static Random rand = new Random(); private static void fillMatrix(char [][]matrix) { //Fill matrix with non-space characters /********************************************* * TODO FILL IN CODE HERE *********************************************/ } private static void burrowMaze(char [][] matrix, int x, int y) { /********************************************* * TODO FILL IN CODE HERE *********************************************/ } private static boolean hasWestNeighbor(char[][] matrix, int x, int y) { return (x-2)>=1 && matrix[x-2][y] != ' '; } private static boolean hasEastNeighbor(char[][] matrix, int x, int y) { return (x+2)=1 && matrix[x][y-2] != ' '; } private static boolean hasSouthNeighbor(char[][] matrix, int x, int y) { return (y+2) Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
