Hi there, I'm attempting to write a program that does the target word puzzles you see in most major newspapers. The target word problem involves a 3x3 grid of 9 random letters that a user needs to be able to make words out of using at least the middle letter and 3 others. No letter can be repeated when making the word but there can be more than the one of the same letter in the grid. First up i'm trying to create the grids using two different arrays, one with the whole alphabet and an empty array where 9 letters will be randomly chosen. I haven't even been able to do this let alone think about the next part of figuring out which words are valid. Here is my code so far...
import java.util.*;
public class array
{
public static void main(String[] args)
{
String a[] = {"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z",};
String[] b;
for (int i=0; i<a.length; i++)
{
System.out.println(a[i]);
}
Random r = new Random();
for (int i=0; i<8; i++)
{
String randomChar = a.charAt(r.nextInt(i));
System.out.println();
}
}
}
Any suggestions/direction or advice about it would be greatley appeciated.
P.S. I don't need it to have a GUI