I'm trying to create a boggle game. I have it so it will setup the board and accept user input. What I am trying to do now is get rid of the "[" braces "]" and the commas to give it a cleaner look and to hopefully make it easier when i try and run a solution check.
Can someone please assist me in getting rid of the braces and commas? I appreciate it.
package testrun3;
import java.util.*;
public class testRun3
{
static String[] alpha = {"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Qu","R","S","T","U","V","W","X","Y","Z"};
static Random rand = new Random();
static ArrayList<String> row1 = new ArrayList<String>();
static ArrayList<String> row2 = new ArrayList<String>();
static ArrayList<String> row3 = new ArrayList<String>();
static ArrayList<String> row4 = new ArrayList<String>();
static ArrayList<String> row5 = new ArrayList<String>();
public static void main(String[] args)
{
code();
System.out.println(row1);
System.out.println(row2);
System.out.println(row3);
System.out.println(row4);
System.out.println(row5);
System.out.println("To end game enter '//'");
System.out.println("Enter words found: ");
endGame();
}
public static void code()
{
row1.add(alpha[produceNumber()]);
row1.add(alpha[produceNumber()]);
row1.add(alpha[produceNumber()]);
row1.add(alpha[produceNumber()]);
row1.add(alpha[produceNumber()]);
row2.add(alpha[produceNumber()]);
row2.add(alpha[produceNumber()]);
row2.add(alpha[produceNumber()]);
row2.add(alpha[produceNumber()]);
row2.add(alpha[produceNumber()]);
row3.add(alpha[produceNumber()]);
row3.add(alpha[produceNumber()]);
row3.add(alpha[produceNumber()]);
row3.add(alpha[produceNumber()]);
row3.add(alpha[produceNumber()]);
row4.add(alpha[produceNumber()]);
row4.add(alpha[produceNumber()]);
row4.add(alpha[produceNumber()]);
row4.add(alpha[produceNumber()]);
row4.add(alpha[produceNumber()]);
row5.add(alpha[produceNumber()]);
row5.add(alpha[produceNumber()]);
row5.add(alpha[produceNumber()]);
row5.add(alpha[produceNumber()]);
row5.add(alpha[produceNumber()]);
}
public static int produceNumber()
{
return (rand.nextInt(alpha.length));
}
public static void endGame()
{
Scanner userInput = new Scanner(System.in);
String input;
input = userInput.nextLine().toUpperCase();
if(input.contains("//"))
{
System.exit(0);
}
else
{
endGame();
}
}// close main
}