/*
 * Skeleton class file for WumpusCave objects
 */

class WumpusCave {

    // these constants can be used to represent the contents of a cave
    public final static int EMPTY = 0;
    public final static int BATS = 1;
    public final static int WUMPUS = 2;
    public final static int PIT = 3;
    
    // define any private fields here
    // ...
    

    /* Construct a new cave with the indicated name. */
    //public WumpusCave(String name)


    /* Get the name of this cave. It should return "unknown" if this
       cave hasn't been visited yet. */
    //public String getName() 


    /* Set the contents of this cave to the indicated inhabitant.
       (see the constants defined at the top of this class for possible
        values of the contents variable) 
    */
    //public void setContents(int contents)
    

    /* Return the contents of this cave */
    //public int getContents() 


    /* Connect this cave to the othercave along the specified tunnel. 
       The value of tunnel will be 0, 1, or 2.
    */
    //public void setConnection(int tunnel, int othercave)


    /* Determine the cave that this cave is connected to along the
       specified tunnel. 
    */
    //public int getConnection(int tunnel)

    
    /* Determine if this cave has been visited yet */
    //public boolean beenVisited() 

    
    /* Visit this cave, marking it so somehow (this should affect the
       result of the beenVisited() and getName() methods above)
    */
    //public void visit() 

    
    /* Return a String representation of this cave, for debugging
       and testing purposes 
    */
    //public String toString()




    /* A sample main method to test your program - everything is
     * commented out right now. Comment/uncomment pieces of this
     * method appropriately to test your implementations of the
     * methods above */
    public static void main(String[] args) {

	/*
        WumpusCave[] caves = new WumpusCave[4];
        caves[0] = new WumpusCave("The Fountainhead");
        caves[1] = new WumpusCave("The Rumpus Room");
        caves[2] = new WumpusCave("Buford's Folly");
        caves[3] = new WumpusCave("The Hall of Kings");
        
        for (int c = 0; c < 4; c++) {
            int conn = 0;
            for (int i = 0; i < 3; i++) {
                if (conn == c) conn++;
                caves[c].setConnection(i, conn);
                conn++;
            }
        }
        
        int wumpi = 2;
        while (wumpi > 0) {
            int pos = (int)(Math.random() * 4);
            if (caves[pos].getContents() == WumpusCave.EMPTY) {
                caves[pos].setContents(WumpusCave.WUMPUS);
                wumpi--;
            }
        }
        
        boolean pitplaced = false;
        while (!pitplaced) {
            int pos = (int)(Math.random() * 4);
            if (caves[pos].getContents() == WumpusCave.EMPTY) {
                caves[pos].setContents(WumpusCave.PIT);
                pitplaced = true;
            }
        }
        
        boolean batsplaced = false;
        while (!batsplaced) {
            int pos = (int)(Math.random() * 4);
            if (caves[pos].getContents() == WumpusCave.EMPTY) {
                caves[pos].setContents(WumpusCave.BATS);
                batsplaced = true;
            }
        }
        
        caves[2].visit();  // just to test
        
        for (int c = 0; c < 4; c++) 
            System.out.println(c + ": " + caves[c]);

	*/
        
    }

    
}