A Java program for word games