Welcome

Hello. This is my new blog/personal site. It is quite new, so there is nothing on it for now except the theme I made. It will be for my blog (of course) and organizing anything for school or hobbies.

My blogs will be about things I think about, experienced, philosophy, logic, and the occasional message. The other parts of my site include the notebook, where I organize any notes or files about school, hobbies, music, and other miscellaneous.

import javax.swing.JOptionPane;  

public class Hangman extends BasicGame 
{  
    private static final String WORDBANK = "applelemonjuicekingswordsbeatsmonkssweetknifespoondizzyatlasglobejesuscrossalloyboroncardslooseliegegirlsghoullevellistsworsegirthzestywaltzviolathrobtogasmarshkneadcrimedeismfrondgyrosplowspearsrunicroguemagesswordsabremorselithezebrawispyslushavian";
    //////////////////////////////////////
    private java.util.Random randy;
    private int guesses;
    private String userGuess;
    private String theWord;
    private String wrongGuess;
    private String theHanged;
    private String displayWord;
    private String indexstring;
    private boolean change;

    public Hangman()  
    { 
        super();   
        randy = new java.util.Random();
        guesses = 0;
        userGuess = "null";
        wrongGuess = "";
        theWord = "";
        theHanged = "";
        displayWord = "";
        indexstring = "";
        change = false;

    } //=======================  

    public void askUsersFirstChoice()  
    { 
        int wordChoice = (5 * randy.nextInt (50)); 
        theWord = WORDBANK.substring (wordChoice, 5 + wordChoice);
        askUsersNextChoice();  
    } //=======================  

    public void askUsersNextChoice()  
    { 
        if (!change)
        {
            theHanged = "";
            if (guesses >= 1)
            theHanged += "O";
            if (guesses >= 2)
            theHanged += "\n/";
            if (guesses >= 3)
            theHanged += "|";
            if (guesses >= 4)
            theHanged += "\\";
            if (guesses >= 5)
            theHanged += "\n/";
            if (guesses >= 6)
            theHanged += " \\";
            if (guesses >= 7)
            failCondition();
        }
        change = false;
        displayWord = "";
        for (int i = 0; i <= 4; i++)
        {
            if(indexstring.contains(Integer.toString(i)))
            displayWord = displayWord + theWord.charAt(i);
            else 
            displayWord = displayWord + "_";
        }
        userGuess = JOptionPane.showInputDialog (null, theWord + "\n" + wrongGuess + "\n" + theHanged + "\n" + displayWord + "\n" + "Guess a letter.");   
        if (userGuess != null && ! userGuess.equals (""))
        {
            for (int f = 0; f <= 4; f++)
            {
                if (f == theWord.indexOf(userGuess))
                {
                    indexstring = indexstring + Integer.toString(f);
                    change = true;
                }
            }
        }
    }  //======================  

    public boolean shouldContinue()    
    { 
        if (userGuess == null)
        System.exit(0);
        return !(indexstring.length() == 4);  
    }  //======================  

    public void showUpdatedStatus()  
    { 
        if (!change)
        {
            guesses++;
            wrongGuess += userGuess;
        }
        askUsersNextChoice();
    } //=======================  

    private void failCondition()
    {
        JOptionPane.showMessageDialog (null, "Unfortunately, you have failed. \n Come back when you are worthy.");
        System.exit (0);
    }

    public void showFinalStatus()    
    { 
        JOptionPane.showMessageDialog (null, theWord + " was right.  \nCongratulations.");  
    }  //====================== 

}