All pastes #716743 Raw Edit

Word

public text v1 · immutable
#716743 ·published 2007-09-27 03:09 UTC
rendered paste body
import java.util.ArrayList;

/**
 * Controls various functions relating to the word being guessed
 * 
 * @author Leon Traill
 * @version 0.01
 */
public class Word
{
    private ArrayList<String> usedWords;
    String wordToConvert;
    
    public Word()
    {
        // Array to hold used words
        usedWords = new ArrayList<String>();
    }
    
    public void checkUsedBefore()
    {
        // Check if the current word has been used before
        /*boolean usedBefore;
        for( int index = 0; index < usedWords.size(); index++ )
        {
            if( usedWords.get(index) == currentWord )
            {
                usedBefore = true;
            }
            else
            {
                usedBefore = false;
            }
        }
        */
    }
    
    public void convertToDashes()
    {
        // Convert currentWord into chars, count and replace with number of dashes
        // Possibly create an array, use dashes as the entries
        System.out.println(wordToConvert);
    }
    
    public void addWord()
    {
        //usedWords.add(dictionary.currentWord);
    }
    
    public void checkGuess()
    {
        // Check player's letter guess against word currently being played
        // Report if it matches an unguessed letter - boolean correctGuess = true;
    }
}