
-----------------------------------
akafurious
Sat Dec 11, 2010 5:35 pm

Help: Boggle in Java
-----------------------------------
I am making a Boggle game, but need some help. the code i have reads a text file that has 5454 words and then makes a game 4x4 game board  by reading the letters of words in the text file. the problem is that i need to use a sorting algorithm the algorithm i picked is  selection sorting but i am having a problem implementing it.


[code]
/*
 * Boggle
 */

import java.util.*; //imports scanner and other userful objects
import java.io.*;  //java input/output for file reading


public class myBoggle
{
    static String[][]game = new String[4][4];
    static String[]words = new String[5454];  //5454 - 4 letter words
    
    
    
    public static void main(String [] args) {

        Scanner input = new Scanner(System.in);  //instantiate scanner object
        readWords(words);
        makeBoard(game);
        printBoard(game);
        
        
        
    }

    
/*readWords reads in the list of all 4 letter words from words.txt file*/
    public static void readWords(String []words){
        File textFile = new File("words.txt");
        FileReader in;
        BufferedReader readFile;
        String line;
        try{
            in= new FileReader(textFile);
            readFile = new BufferedReader(in);
            for (int i=0; i