Hunt the Wumpus

Hey, I'm pretty new to Java (since September actually) and have been give this assignment in school to create the game, Hunt the Wumpus. Honestly I have no idea of where to start with this. Can anyone lead me in the right direction. Thanks. Below are the instructions that were given to do this.
Backstory
The first programming assignment for the course CPS 109 Computer Science I is to implement a real dinosaur and the original grandfather of our modern computer games, Hunt the Wumpus. Despite being rather lame by today's gaming standards, this game is hopefully an educational topic to serve as your first programming project.
Wumpus is a game played on a maze which for our purposes is a rectangular grid of rooms. From each room it is possible to move to any of the adjacent rooms in north, west, south and east, unless you are at the edge of the grid to that direction. The maze is dark, so in each room you can see only that room, but you can't see through the doors what the adjacent rooms might contain.
You are a brave explorer armed with a bow and a quiver of arrow to search the maze for the pile of gold that is rumored to be hidden in one of the rooms. You enter the maze at the entrance room at the coordinates (1,1), and win the game if you successfully find the gold and manage to return to the same entrance alive. If you enter the room where the pile of gold is located, you automatically pick it up.
Beware, though, since the maze is also a home for the mythical monster known as the Wumpus! Wumpus is rather stupid and bestial and pretty much just moves randomly around the maze. If you and Wumpus happen to meet at the same room, game is over for you, since you are no match for the Wumpus in close quarters combat. Your only chance of survival is to either avoid the Wumpus or to kill him with a well-aimed shot from your trusty bow.
To shoot, pick any of the four directions and hope for the best. When you shoot, your arrow will fly through three rooms to that direction and then hit the stone floor, shattering to useless shards. If the Wumpus happens to be in any of those three rooms on the path of the arrow, he is hit and he dies.
Classes and methods to write
In this project, you need to write two classes called WumpusGrid and WumpusGame. The first class simulates the Wumpus world, while the second class implements the interface. The class WumpusGrid should have whatever private fields and methods you need, and the following public methods:
void startNewGame(int width, int height, int arrows)
Starts a new game and initializes the grid to the given width and height so that the player is in the room (1,1) and carries arrows arrows. Wumpus and the pile of gold are placed in random rooms in the grid, but not in the room (1,1).
boolean isGameOn()
Returns true if the player has not yet died or successfully completed his task, otherwise returns false.
int getArrowCount()
Returns the number of arrows that the player is currently carrying in his quiver.
boolean isCarryingGold()
Returns true or false depending on whether player is currently carrying the gold.
int getX()
Returns the x-coordinate of the room that the player is currently in.
int getY()
Returns the y-coordinate of the room that the player is currently in.
String moveWumpus()
If Wumpus is alive, moves the Wumpus from the room that he is currently in to a randomly chosen adjacent room in one of the four directions. This method returns a message string:
If Wumpus moves to the same room as the player, the game ends and the message is �The Wumpus eats you!�
If the Manhattan distance (find out yourself what this is) between Wumpus and player is one, the message is �You can smell the putrid breath of the Wumpus!�
If the Manhattan distance between Wumpus and player is two, the message is �You can hear the Wumpus slouching nearby!�
If the Manhattan distance between Wumpus and player is three, the message is �You can sense the Wumpus lurking nearby!�
String movePlayer(int dx, int dy)
Moves the player from his current room (x,y) to the adjoining room (x+dx, y+dy), unless that move would take him outside the grid, or it is not the case that one of the parameters is zero while the other is -1 or +1. The method returns a message string:
If the player moves to the same room as the living Wumpus, the game ends and the message is �The Wumpus catches you and dismembers you!�
If the player moves to the same room as the dead Wumpus, the message is �The carcass of the Wumpus lies on the ground.�
If the player moves to a room that has the pile of gold in it, he picks it up and the message is �You have found the treasure that you are looking for!�
If the player is carrying the gold and moves to the room (1,1) so that Wumpus is not there, the game ends and the message is �You survived to bring the gold back home and live rich and happy for the rest of your life!�
Otherwise, the message is �This room is dark and empty.�
String shootArrow(int dx, int dy)
Shoots one arrow to the direction specified by dx and dy, as in the previous method. The method returns a message string:
If the player has no arrows left, the message is �You want to shoot, but your quiver is empty!�
If the player shoots and hits nothing, the message is �The arrow flies into the darkness.�
If the player shoots and hits the Wumpus, the Wumpus dies and the message is �You hear the Wumpus scream horribly and then collapse to the ground!�
The class WumpusGame allows the human user to play this game over a textual console interface. This game should proceed in turns so that each turn, the game outputs the current coordinates of the player and the number of arrows in his quiver, and asks him what he wants to do. The possible answers are either �n�, �e�, �s�, �w� to move to the given direction, �sn�, �se�, �ss�, �sw� to shoot an arrow to the given direction, or �q� to quit the game. The message that the action produces is shown to the player, and then it is Wumpus's turn to move. This is repeated until the player either dies, quits or wins the game. Whatever way the game ends, the program should ask the player if he wants to play a new game, and exit if he answers no.
The class WumpusGame must have the main method for the game to run as a standalone application, and whatever other methods you wish to put there to implement the game functionality of the previous paragraph.
If you want to, you can also write a class Position that stores a pair of (x,y) coordinates, with methods to calculate the position to a given direction, and use objects of this class to represent and store the positions of player, Wumpus and gold.

Thanks very much for telling me how to post a question. As you know I'm new here, so I don't know the procedure of things around here. I know how to create an interface, but I was wondering if I'm going about this wrong. This is just what I have to make the "player" on the game interface.
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.geom.Ellipse2D;
import javax.swing.JPanel;
import javax.swing.JComponent;
public class WumpusGrid extends JComponent
    //Creates the explorer the player is going to use.
    public void paintComponent(Graphics g)
        //Recover Graphics2D
        Graphics2D g2 = (Graphics2D) g;           
        //Draws the brave explorer.
        Ellipse2D.Double man = new Ellipse2D.Double(1,1,5,5);
        g2.setColor(Color.RED);
        g2.fill(man);
}This is what I have for the game interface.
import javax.swing.JFrame;
public class WumpusGame
    public static void main(String[] args)
        JFrame frame = new JFrame();
        frame.setSize(200,200);
        frame.setLocation(100,100);       
        frame.setTitle("Hunt the Wumpus");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        WumpusGrid component = new WumpusGrid();
        frame.add(component);
        frame.setVisible(true);
}

Similar Messages

  • Help with a hunt the wumpus game

    I accidently posted this question on the wrong section so i'm posting it again here.
    i'm trying to write the hunt the wumpus game with simple conditions: (check-marked the ones i already accomplished)
    [x]the pits will be placed randomly
    [x] the wumpus is placed in the maze randomly (not sure if i did that one correctly)
    [x] the player starts on the lower left of the maze row 3 col 0
    -the player will only have 1 chance to shoot the Wumpus
    [x]if the player is close to the Wumpus then there would be a prompt saying there is stench around
    [x]if the player is close to a pit then she/he will be prompted that there is a breeze.
    -if the player falls in a pit or gets eaten by the wumpus the game will be over and the map of the maze will be shown. I used 0 for empty cells and p for pits and w for wumpus in the array.
    There is some problem with the program i've written so far but i don't know how to fix it. also, i don't know how to check if the wumpus will be in the direction the player wants to shoot. i'd appreciate any suggestions
    import java.util.*;
    public class playWumpus
        //initMaze METHOD
        //put the pits and wumpus into the world
        public static void initMaze(char [][] maze)
            Random r = new Random();
            for (int row = 0; row <4; row ++)
                maze[row][col] = '0';    <<<<<<there is a problem here: col cannot be resolved
            int pitRow, pitCol;
            for (int pitNum = 0; pitNum <4; pitNum++)
                pitRow = r.nextInt(4); //randomly choose row
                pitCol = r.nextInt(6); //randomly choose column
                if (pitRow == 3 && pitCol == 0)//start location
                    pitCol=5;
            maze [pitRow][pitCol] = 'p'; //places the pits in the maze randomly
            maze [r.nextInt(4)][r.nextInt(6)] = 'w'; //places the wumpus randomly in the maze
        }// end of Maze method
        //CHECKMOVE method
        //possible outcomes: run into the wall , fall into the pit, eaten by wumpus,
        //feel breeze, smell stench, nothing.
        public static int checkMove(char [] [] maze, int newRow, int newCol)
            //checks if they run into a wall
            if (newRow<0 || newRow>3 || newCol<0 || newCol>5)
                System.out.println("You hit a wall");
                return 0;
                // it will return to the main method and places 0 in the state variable
            else if (maze[newRow][newCol] == 'p') 
            //this checks the maze if there is a P in that location
                System.out.println("You fall into a pit");
                return 2;
                // it will return to the main method and places 2 in the state variable
            else if (maze[newRow][newCol] == 'w')//checks for the wumpus
                System.out.println("You've eaten by the Wumpus!!");
            //checks for the breeze (right,left,down,up)   //<<is the following if-statement correct?>>>
            if (
                (newCol>0 && maze[newRow][newCol-1] == 'p') ||
                (newCol<5 && maze[newRow][newCol+1] =='p') ||
                (newRow>0 && maze[newCol][newRow-1] == 'p') ||
                (newRow<3 && maze[newCol][newRow+1] =='p')
                System.out.println("You feel a breeze");
            return 1;
        }//end of the maze method
        public static void main(String [ ] args)
            char [ ] [ ] maze = new char [4][6]; //the actual map of the game
            int playerRow=3, playerCol=0;  // player location aka lat/long
            Scanner in= new Scanner(System.in);   //<<there is something wrong with my scanner:The method nextInt(int) in the type Scanner is not applicable for the arguments (InputStream)>>>
            int move, state;
            // state of the game
            // state   0= illegal move, 1= legal move, 3= end game
            initMaze (maze); // calling the initMaze method
            do
                System.out.println("What would you like to do? 1=up, 2=down, 3=right 4=left, 5=shoot");
                move = in.nextInt(System.in);   //<<eclipse is telling me that the type is incorrect>>
                if (move ==1) // move up in the world
                    state = checkMove(maze, playerRow-1,playerCol); //these are coordinates
                    if ( state >0 ) // legal move
                        playerRow = playerRow-1;
                if (move ==2) // move down in the world
                    state = checkMove(maze, playerRow+1,playerCol);
                    if ( state >0 ) // legal move
                        playerRow = playerRow+1;
                if (move ==3) // move right in the world
                    state = checkMove(maze, playerRow,playerCol+1);
                    if ( state >0 ) // legal move
                        playerCol = playerCol+1;
                if (move ==4) // move left in the world
                    state = checkMove(maze, playerRow,playerCol-1);
                    if ( state >0 ) // legal move
                        playerRow = playerCol-1;
                if (move == 5) // shoot the wumpus in the world
                    System.out.println("Which direction would you like to shoot? 1=up, 2=down, 3=right, 4=left");
                    int shootDir = in.nextInt(System.in);
                    // check if the wumpus gets killed
                    if (  shootDir == 1 )  //<<not sure on how to check if the dir they are shooting has the wumpus in there>>
                        System.out.println("You shot the Wumpus!");
            }while (state!=2);
        }//end of main
    }//end of class

    here is the whole code just in case you guys want to see it...yes i know it looks primitive to you experts but hey i can follow and understand what i've written and that's what matters ^.~))V
    import java.util.*;
    public class playWumpus
         //initMaze METHOD
         //put the pits and wumpus into the world
         public static void initMaze(char [][] maze)
              Random r = new Random();
              for (int row = 0; row <4; row ++)
                for (int col = 0; col<6; col ++)
                    maze[row][col] = '0';             
              int pitRow, pitCol;
              for (int pitNum = 0; pitNum <4; pitNum++)
                   pitRow = r.nextInt(4); //randomly choose row
                   pitCol = r.nextInt(6); //randomly choose column
                   if (pitRow == 3 && pitCol == 0)//start location
                        pitCol=5;
                   maze [pitRow][pitCol] = 'p'; //places the pits in the maze randomly
              int wumpusRow = r.nextInt(4);
              int wumpusCol = r.nextInt(6);
              maze [wumpusRow][wumpusCol] = 'w'; //places the wumpus randomly in the maze
         }// end of Maze method
         //CHECKMOVE method
         //possible outcomes: run into the wall , fall into the pit, eaten by wumpus,
         //feel breeze, smell stench, nothing.
         public static int checkMove(char [] [] maze, int newRow, int newCol)
              //checks if they run into a wall
              if (newRow<0 || newRow>3 || newCol<0 || newCol>5)
                   System.out.println("You hit a wall");
                   return 0;
                   // it will return to the main method and places 0 in the state variable
              //this checks the maze if there is a pit in that location
              else if (maze[newRow][newCol] == 'p') 
                   System.out.println("You fall into a pit. You lose!");
                   return 2;
              //checks for the wumpus
              else if (maze[newRow][newCol] == 'w')
                   System.out.println("You've been eaten by the Wumpus. You lose!!");
                   return 2;
              //checks for the breeze (right,left,down,up)
              if (
                   (newCol>0 && maze[newRow][newCol-1] == 'p') ||
                   (newCol<5 && maze[newRow][newCol+1] =='p') ||
                   (newRow>0 && maze[newCol][newRow-1] == 'p') ||
                   (newRow<3 && maze[newCol][newRow+1] =='p')
                   System.out.println("You feel a breeze");
              //checks for the wumpus' stench
              else if (
                        (newCol>0 && maze[newRow][newCol-1] == 'w') ||
                        (newCol<5 && maze[newRow][newCol+1] =='w') ||
                        (newRow>0 && maze[newCol][newRow-1] == 'w') ||
                        (newRow<3 && maze[newCol][newRow+1] =='w')
                        System.out.println("Something smells!!");
                        return 1;
              else
                   System.out.println("Nothing happens.");
                   return 1;
              return 1;
         }//end of the maze method
         public static void main(String [ ] args)
              char [][] maze = new char [4][6]; //the actual map of the game
              int playerRow=3, playerCol=0;  // player location
              Scanner in= new Scanner(System.in);
              int move;
              int state = 1;
              // state of the game
              // state   0= illegal move, 1= legal move, 3= end game
              initMaze (maze); // calling the initMaze method
              do
                   System.out.println("What would you like to do? 1=up, 2=down, 3=right 4=left, 5=shoot");
                   move = in.nextInt();
                   if (move ==1) // move up in the world
                        state = checkMove(maze, playerRow-1,playerCol); //these are coordinates
                        if ( state > 0 ) // legal move
                             playerRow = playerRow-1;
                   if (move ==2) // move down in the world
                        state = checkMove(maze, playerRow+1,playerCol);
                        if ( state >0 ) // legal move
                             playerRow = playerRow+1;
                   if (move ==3) // move right in the world
                        state = checkMove(maze, playerRow,playerCol+1);
                        if ( state > 0 ) // legal move
                             playerCol = playerCol+1;
                   if (move ==4) // move left in the world
                        state = checkMove(maze, playerRow,playerCol-1);
                        if ( state >0 ) // legal move
                             playerCol = playerCol-1;
                   if (move == 5) // shoot the wumpus in the world
                        System.out.println("Which direction would you like to shoot? 1=up 2=down 3=right 4=left");
                        int shootDir = in.nextInt();
                        if (shootDir==1 && playerRow>0)
                             if (maze[playerRow-1][playerCol] == 'w')
                                  System.out.println("You shot the Wumpus!");break;
                             else
                                  System.out.println("You missed! You lose!");break;
                        else if(shootDir==2 && playerRow<3)
                             if (maze[playerRow+1][playerCol] == 'w')
                                  System.out.println("You shot the Wumpus!");break;
                             else
                                  System.out.println("You missed! You lose!");break;
                        else if (shootDir==3 && playerCol<5)
                             if (maze[playerRow][playerCol+1] == 'w')
                                  System.out.println("You shot the Wumpus!");break;
                             else
                                  System.out.println("You missed! You lose!");break;
                        else if (shootDir==4 && playerCol>0)
                             if (maze[playerRow][playerCol-1] == 'w')
                                  System.out.println("You shot the Wumpus!");break;
                             else
                                  System.out.println("You missed! You lose!");break;
              }while (state!=2);
              //shows the user the map of the maze if he/she gets eaten or falls in a pit
                   for(int row=0;row<4;row++,System.out.println())
                        for(int col=0;col<6;col++)
                             String loc = ""+maze[row][col];
                             loc += ((row == playerRow) && (col == playerCol)) ? "*" : "";
                             System.out.print(loc+"\t");
         }//end of main
    }//end of class

  • I need help: hunt the wumpus game

    i'm trying to write the hunt the wumpus game with simple conditions: (check-marked the ones i already accomplished)
    [x]the pits will be placed randomly
    [x] the wumpus is placed in the maze randomly (not sure if i did that one correctly)
    [x] the player starts on the lower left of the maze row 3 col 0
    -the player will only have 1 chance to shoot the Wumpus
    [x]if the player is close to the Wumpus then there would be a prompt saying there is stench around
    [x]if the player is close to a pit then she/he will be prompted that there is a breeze.
    -if the player falls in a pit or gets eaten by the wumpus the game will be over and the map of the maze will be shown. I used 0 for empty cells and p for pits and w for wumpus in the array.
    There is some problem with the program i've written so far but i don't know how to fix it. also, i don't know how to check if the wumpus will be in the direction the player wants to shoot. i'd appreciate any suggestions
    import java.util.*;
    public class playWumpus
        //initMaze METHOD
        //put the pits and wumpus into the world
        public static void initMaze(char [][] maze)
            Random r = new Random();
            for (int row = 0; row <4; row ++)
                maze[row][col] = '0';    <<<<<<there is a problem here: col cannot be resolved
            int pitRow, pitCol;
            for (int pitNum = 0; pitNum <4; pitNum++)
                pitRow = r.nextInt(4); //randomly choose row
                pitCol = r.nextInt(6); //randomly choose column
                if (pitRow == 3 && pitCol == 0)//start location
                    pitCol=5;
            maze [pitRow][pitCol] = 'p'; //places the pits in the maze randomly
            maze [r.nextInt(4)][r.nextInt(6)] = 'w'; //places the wumpus randomly in the maze
        }// end of Maze method
        //CHECKMOVE method
        //possible outcomes: run into the wall , fall into the pit, eaten by wumpus,
        //feel breeze, smell stench, nothing.
        public static int checkMove(char [] [] maze, int newRow, int newCol)
            //checks if they run into a wall
            if (newRow<0 || newRow>3 || newCol<0 || newCol>5)
                System.out.println("You hit a wall");
                return 0;
                // it will return to the main method and places 0 in the state variable
            else if (maze[newRow][newCol] == 'p') 
            //this checks the maze if there is a P in that location
                System.out.println("You fall into a pit");
                return 2;
                // it will return to the main method and places 2 in the state variable
            else if (maze[newRow][newCol] == 'w')//checks for the wumpus
                System.out.println("You've eaten by the Wumpus!!");
            //checks for the breeze (right,left,down,up)   //<<is the following if-statement correct?>>>
            if (
                (newCol>0 && maze[newRow][newCol-1] == 'p') ||
                (newCol<5 && maze[newRow][newCol+1] =='p') ||
                (newRow>0 && maze[newCol][newRow-1] == 'p') ||
                (newRow<3 && maze[newCol][newRow+1] =='p')
                System.out.println("You feel a breeze");
            return 1;
        }//end of the maze method
        public static void main(String [ ] args)
            char [ ] [ ] maze = new char [4][6]; //the actual map of the game
            int playerRow=3, playerCol=0;  // player location aka lat/long
            Scanner in= new Scanner(System.in);   //<<there is something wrong with my scanner:The method nextInt(int) in the type Scanner is not applicable for the arguments (InputStream)>>>
            int move, state;
            // state of the game
            // state   0= illegal move, 1= legal move, 3= end game
            initMaze (maze); // calling the initMaze method
            do
                System.out.println("What would you like to do? 1=up, 2=down, 3=right 4=left, 5=shoot");
                move = in.nextInt(System.in);   //<<eclipse is telling me that the type is incorrect>>
                if (move ==1) // move up in the world
                    state = checkMove(maze, playerRow-1,playerCol); //these are coordinates
                    if ( state >0 ) // legal move
                        playerRow = playerRow-1;
                if (move ==2) // move down in the world
                    state = checkMove(maze, playerRow+1,playerCol);
                    if ( state >0 ) // legal move
                        playerRow = playerRow+1;
                if (move ==3) // move right in the world
                    state = checkMove(maze, playerRow,playerCol+1);
                    if ( state >0 ) // legal move
                        playerCol = playerCol+1;
                if (move ==4) // move left in the world
                    state = checkMove(maze, playerRow,playerCol-1);
                    if ( state >0 ) // legal move
                        playerRow = playerCol-1;
                if (move == 5) // shoot the wumpus in the world
                    System.out.println("Which direction would you like to shoot? 1=up, 2=down, 3=right, 4=left");
                    int shootDir = in.nextInt(System.in);
                    // check if the wumpus gets killed
                    if (  shootDir == 1 )  //<<not sure on how to check if the dir they are shooting has the wumpus in there>>
                        System.out.println("You shot the Wumpus!");
            }while (state!=2);
        }//end of main
    }//end of class

    First you need to fix some basic errors:
    1)
    move = in.nextInt(System.in);   Should be:
    move = in.nextInt();   2) You have to initialize some of your vairables like pitRow, pitCol, and col...maybe more...
    3) As for your 'col' variable you need to implement not only the rows but columns as well. Maybe you could do something like this:
    for (int row = 0; row <4; row ++)
                 for(int col = 0; col < 4; col ++)
                maze[row][col] = '0';   // <<<<<<there is a problem here: col cannot be resolved
            }Hope this helps.

  • Hunting the yoyo blue box

    Hello world,
    As I said in an earlier post, I am ready to do some target shooting. I drew a box, gave it a name, and making it move in a yoyo manner horizontally. What I want to, is the following:
    Every time I detect a collision, I will hear a different sound. Instead of my usual bang.mp3, it's going to be bang2. mp3.  But I have a problem about the collision. Is it going to be between my movieclip_1 and my_box, or
    boom( the impact hole) and the my_box. I understand the collision thing, but it is still a mystery, like the seasons and the tide of the sea. here the code:
    import fl.transitions.Tween;
    import fl.transitions.easing.*;
    import fl.transitions.TweenEvent;
    var myTween = new Tween(my_box,"x",Strong.easeInOut,10,600,1,true);
    myTween.addEventListener(TweenEvent.MOTION_FINISH, onFinish);
    function onFinish(e:TweenEvent):void
    e.target.yoyo();
    var mySound1:Sound = new Sound();
    var myChannel1:SoundChannel = new SoundChannel();
    mySound1.load(new URLRequest("bang2.mp3"));
    var mySound:Sound = new Sound();
    var myChannel:SoundChannel = new SoundChannel();
    mySound.load(new URLRequest("bang.mp3"));
    stage.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler_2);
    this.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler_2);
    function fl_MouseClickHandler_2(event:MouseEvent):void
    if (movieClip_1.hitBool)
      mySound.play(1,1);
      var boom:Boom=new Boom();
      addChild(boom);
      boom.x = mouseX;// not sure this is what you want form x,y
      boom.y = mouseY;
    stage.addChild(movieClip_1);
    movieClip_1.mouseEnabled = false;
    movieClip_1.addEventListener(Event.ENTER_FRAME, fl_CustomMouseCursor_2);
    function fl_CustomMouseCursor_2(event:Event)
    if (movieClip_1.hitTestPoint(stage.mouseX,stage.mouseY))
      movieClip_1.hitBool = true;
    else
      movieClip_1.hitBool = false;
    movieClip_1.x = stage.mouseX;
    movieClip_1.y = stage.mouseY;
    Mouse.hide();

    Morning
    The soccer game was lame. Thank you for helping.
    Your answer is  right, but it is redundant. Why create a new function that would conflict with the existing one with its own set of condition? What I did, is
    to put the hitTestObject condition in the existing one that has all the action. Here what I did : this way, the trace appears in the output panel.  but when I put a new action like  mySound1.play(1,1);, there is nothing happening when the hitTest occurs. I should be hearing the new sound bang1.mp3.
    Why not?
    this.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler_2);
    function fl_MouseClickHandler_2(event:MouseEvent):void
    if (movieClip_1.hitBool)
      mySound.play(1,1);
      var boom:Boom=new Boom();
      addChild(boom);
      boom.x = mouseX;// not sure this is what you want form x,y
      boom.y = mouseY;
       if (movieClip_1.hitTestObject(my_box));
       trace("Collision detected!");
       mySound1.play(1,1);

  • Hunt the serial number!

    I need to get the serial number of my stolen ipod nano, which I understand would have been recorded with itunes (on about itunes) when it was synced last. However, my itunes have been upgraded since I last synced it and it the serial number isn't on the newer version.  Is there any way of finding the previously recorded information?  Would it be hidden in the depth of my computer memory somewhere?  Or is it lost for good?
    Thanks

    If you registered the iPod Nano, Apple will have a record of it as well as the online Apple Store if you purchased it from them. 

  • Store Moves to memory

    I have a simple twist on the hunt the Wumpus game where the object is to find a pile of smelly socks and then return to the starting position. My code is very basic and not the most intelligent agent but it gets the job done. the problem I am having is returning to the starting position. I have considered using an array or a stack but I am unsure how to implement it. Thanks for reading
    import java.applet.Applet;
       import java.util.Random;
       import javax.swing.JOptionPane;
        public class WumpusWorld extends Applet
           public void init ()
             Room   edsRoom = new Room("wumpusworld.room", this);
             Butler james   = new Butler (18, 3, edsRoom);
             System.out.print(james.getX());
           System.out.print ( james.getY()); 
             edsRoom.waitForStart();
             int[] move = new int[600];
             int index = 0;
             Random rand = new Random();
             while(true)
                while(james.isFrontClear() == true)
                   james.forward();     
                   move[index]++;
                              System.out.print(move[index]+"Shit\n");
                while(james.isFrontClear() == false && james.isLeftClear()||james.isRightClear())
                   if(Math.random() < .25)
                      james.turnLeft();
                   else if(Math.random() < .25)
                      james.turnRight();
                   while(james.isFrontClear())
                      james.forward();
                      move[index]++;
                   if(james.isFrontClear() == false && james.isLeftClear() == false && james.isRightClear() == false)
                      james.backward();
                      james.turnLeft();
                   if(james.senseSmell() == 96 && james.seeSocks())
                      james.pickUp();
                      james.forward();
                      move[index]--;
                      System.out.print(move[index]+"Number of moves");
                                  String outputStr;
                                  outputStr = "Health"+james.getHealth();
                                  JOptionPane.showMessageDialog(null,outputStr,"HEALTH",JOptionPane.INFORMATION_MESSAGE);
                                  System.out.print(james.getHealth());            
                while(true)
                   System.out.println(james.senseSmell());
                   System.out.println(james.senseBreeze());
                   System.out.println(james.senseHeat());
                   System.out.println(james.seeSocks());
                   james.forward();
                   System.out.println(james.senseSmell());
                   System.out.println(james.senseBreeze());
                   System.out.println(james.senseHeat());     
                   System.out.println(james.seeSocks());
                //james.forward();
                   System.out.println(james.senseSmell());
                   System.out.println(james.senseBreeze());
                   System.out.println(james.senseHeat());
                   System.out.println(james.seeSocks());
                //james.forward();
                //james.forward();
                   System.out.println(james.senseSmell());
                   System.out.println(james.senseBreeze());
                   System.out.println(james.senseHeat());     
                   System.out.println(james.seeSocks());
                //james.forward();
                //james.forward();
                   System.out.println(james.senseSmell());
                   System.out.println(james.senseBreeze());
                   System.out.println(james.senseHeat());     
                   System.out.println(james.seeSocks());
                //james.forward();
                   System.out.println(james.senseSmell());
                   System.out.println(james.senseBreeze());
                   System.out.println(james.senseHeat());     
                   System.out.println(james.seeSocks());
                //james.turnLeft();
                   System.out.println(james.senseSmell());
                   System.out.println(james.senseBreeze());
                   System.out.println(james.senseHeat());     
                   System.out.println(james.seeSocks());
                //james.forward();
                   System.out.println(james.senseSmell());
                   System.out.println(james.senseBreeze());
                   System.out.println(james.senseHeat());     
                   System.out.println(james.seeSocks());
                //james.forward();
                   System.out.println(james.senseSmell());
                   System.out.println(james.senseBreeze());
                   System.out.println(james.senseHeat());     
                   System.out.println(james.seeSocks());
                //james.forward();
                   System.out.println(james.senseSmell());
                   System.out.println(james.senseBreeze());
                   System.out.println(james.senseHeat());
                   System.out.println(james.seeSocks());
                //james.forward();
                   System.out.println(james.senseSmell());
                   System.out.println(james.senseBreeze());
                   System.out.println(james.senseHeat());
                   System.out.println(james.seeSocks());
                //if (james.seeSocks()) james.pickUp();
                   System.out.println(james.getHealth());
             //james.turnLeft(2);
             //james.forward(4);
             //james.turnRight();
             //james.forward(7);
       }

    I looked into the approaches and I appreciate the idea because I had never heard of those algorithms before and for a more advanced project i will look into those. I think for this project a stack or array will be more ideal. I have a working stack now that stores a value for each move. forward = 1, backward = -1, left = 2, and right = 3. Now i dont know how to go about the pop. should i use a case switch or if statements. The plan is to swap the values, that is when bactracking backward = 1, forward = -1, right = 2, and left = 3. here is the new code.
       import java.applet.Applet;
       import java.util.Random;
       import javax.swing.JOptionPane;
       import java.util.*;
        public class WumpusWorld extends Applet
           public void init ()
             Room   edsRoom = new Room("wumpusworld.room", this);
             Butler james   = new Butler (18, 3, edsRoom);
             edsRoom.waitForStart();
             int direction = 0;
             boolean n = true;
                        Random rand = new Random();
             Stack movesMade = new Stack();
             while(james.seeSocks() == false)
                if(james.isFrontClear() == true){
                   james.forward();
                   movesMade.push(new Integer(1));
                    if(james.isFrontClear()
                      james.forward();
                      movesMade.push(new Integer(1));
                   if(james.isFrontClear() == false && james.isLeftClear()||james.isRightClear())
                   direction = rand.nextInt(2);
                      if(direction == 0)
                         james.turnLeft();
                         movesMade.push(new Integer(2));
                      else if(direction == 1)
                         james.turnRight();
                         movesMade.push(new Integer(3));
                   if(james.isFrontClear() == false && james.isLeftClear() == false && james.isRightClear() == false)
                      james.backward();
                      movesMade.push(new Integer(-1));
                      james.turnLeft();
                      movesMade.push(new Integer(2));
                   else if(james.senseSmell() == 96 && james.seeSocks() )
                      james.pickUp();
                      break;
                while(!movesMade.empty())
              // Insert backtracking pop here

  • What Are the Exact Basic rules for Replying a Thread...... -:)   @};-

    Hi Experts,
    After Looking into the forums many days I had a small conclusion about forums,
    SAP Forums are better place I have seen for getting a goo dhelp & Knowledge...
    Why can't we make it a BEST Place.
    This is just a small doubt which I would like to clear myself first,
    I have seen many users In the forums asking for a Basic Questions
    When cleared, But still they want to have a Spoon feeding with a Sample Code.
    When Sample Code Given they will provide the original code and requests for Modifications.
    These always looks to me as crazy.
    I have seen somelong time agin by moderators posting that In SCN there will be no SPOON FEEDING.
    I am not sure whether if still this Rule AVAILABLE or NOT.
    Ok if the task is really difficult let them ask again and again,
    And it was not replied, let them repost, I agree with them.
    And How about a User Registered in SDN very long back and asking for a silly question in below thread,
    [Sendin Email to the recipent list -Need correct FM |Getting the address from shipto partner of Bil. item not directly from C.ma]
    This is one more example, really funny, The thread poster needs the solution at any cost, he doesn't require and Suggetions,,, {He Only needs Solution}
    [Radio Buttons |Radio Buttons;
    [Turning Off Debugger |Turning Off Debugger;
    [Regarding Amount in words|Regarding Amount in words;
    There are 100's of threads like this....Everyone knows this facts.
    Check this who answered this one and who replied correct answer, who copied, finally who was rewarded...!
    [how to validate POsting period |Re: how to validate POsting period]
    Now My Real Problem is....!
    User is always intelligent, Only the weakness is in Contributor, trying to help them,..,
    And I openly say that Someone requesting for basic help is not DUMB, But the Contributor replying forgets
    the basic rules " Why Contributing ?"
    According to me It's not the Requestor to see Rules & Requlations before posting the threads,
    But its responsibilty for the Contributing person to see th Rules & Requlations before replying the threads,
    If we follow the rules and stand on a single word or rule or anything there will be Good Result.
    Major Problem is in US not anyone else.
    Example Some one saying search in the forum,,, then please no replies after that...
    But we are very pity hearted again we post the solution,,,
    But it is not at all enough(for cintribtor's)... they will copy the solution and post again by slight Modifications,
    And Some users are having 500,600,700,800 Posts with 0 points, registered long long back.
    They are completly dependent on forums,,, As they goto office and as they eat, The same they open forums and ask Queries...
    They will never realize what they are doing,, and we will never let them improve better...
    Finally Lets Discuss About this and Correct & Suggest me if I am wrong,
    Is my thoughts are going in the right way or not I am not even sure... Please Aslo Correct me if I did any mistakes.
    Thanks & regards,
    Dileep .C
    Edited by: Dileep Kumar Chinnaiah on Apr 29, 2009 12:33 PM
    Title Changed Form
    "What to do when someone asking for Basic Questions" to "What Are the Exact Basic rules for Replying a Threads...... "

    Hi Stephen,
    Very useful Information,
    First tell me a little something about my self...
    After completion of my certification(as a fresher) I was down the streets hunting the job,
    with the insufficient knowledge and being a non-experienced person, I never got one.
    And mean while when I got my "S-UserID", I used to be proud, To say frankly, I registerd in SDN & SAP all at a time, without even knowing what I can do there..,
    When I got a job afterwords I was doing the job and never seen SDN page for many months,
    when I came to know that of we have doubts we can post at SDN. then started requesting help,
    I posted only a little, I didnot got the proper response. on that day I decided,
    still there are some places where we cannot get help on time and there will be people waiting to get help,
    Why cant I put some of my efforts to help others.
    Then I searched some topic by Topic in SDN topic by Topic I used to read threads just for knowledge.
    when I feel my self comfort for contributing, I started contibuting...!
    If you haven't read it, take a look first, so you can understand where things are now.
    I dont know where things are now. But these in this thread I mentioned clearly what I seen from the day I started contributing.
    I searched with the terms of 'Rules for replying', The results are not as I expected, and this link has subject as
    "O SDN, where art thou?" So it dosent hit my in the list.
    Like everybody until a certain stage I am also rushing for points.
    But I most cases I never tried to copy paste answers. If I done some then that is just to point it myself some day,
    I have no hopes or no intrest on the points...! This was discussed with Rob & Matt, at my inital contribution where my points are 36.
    From that day till date I have changed a lot to myself.
    Everyone cannot change like me because they are not like me & And I dont even expect that...!
    I will be online almost 6-8Hrs a day, Not even getting intrest to see the forums just because of the co-contributors.
    My only point is I am just requesting to a co-contributor,
    Clearly In a example : Lets say contributor has replied to a thread, and if you know that is a correct solution,
    please dont reply any more, If you have a better solution than that, then only reply,
    Even there is one reply in the thread not a matter, if correct answer leave that query.
    If still error persists, Show up with your Idea's...
    Dont let down the contributor, by copying his reply and editing and pasting(edit only if incorrect).
    I am just looking for this one exactly to circulate between ourselfs.
    For this we a little support from moderators to circulate(may be as a rule or may be as a mail to them)
    You may say again how many mails we have to send, It dosent matter, one mail to one person one time,
    and +ve factors will show up definetly.
    A real contributor always understand what I am talking about, but some one who hunts for points will never.
    I am really sorry if I am troubling with my doubts & requests,
    If so, Pleae forgive me,,
    Thanks & regards,
    Dileep .C

  • To run an application on iAS6sp1 on HP-Unix, while starting the kjs from command line, it gives a GDS error and crashes. Subsequently, after stopping all services and restarting iAS wouldnot come up.

     

    Hi,
    Not a problem, please post the KJS error logs for me to hunt the
    exact reason for the error.
    Thanks & Regards
    Raj
    Neel John wrote:
    To run an application on iAS6sp1 on HP-Unix, while starting the kjs
    from command line, it gives a GDS error and crashes. Subsequently,
    after stopping all services and restarting iAS wouldnot come up.
    Try our New Web Based Forum at http://softwareforum.sun.com
    Includes Access to our Product Knowledge Base!

  • PE9: YouTube "Error occur during the uploading"

    I have uploaded over 50 videos to YouTube using PE9 and previous versions, but now - after 4 attempts - I get the same well-worn error message: "Sorry an error occur (sic) during the uploading process. Please try again later".
    I use the Share facility that I always do and I have not installed any new software. Hunting the Forums suggested disabling anti-virus software (in my case AVG) which I have done. It is always in the final stage "Transferring to YouTube". I have shot in XP+ from my Canon Legria HFS10.
    The editing process to reduce to 10 minutes from 20 went without a hitch.
    (Previous efforts can be seen if you're desperate by hunting for Basset Hound Walkers).
    Any ideas most welcome. Should I convert to a different format? - though it has worked before. Are YouTube having problems?
    Many thanks.

    First, glad to hear that you were able to Export then upload. That is a first step, and a big one - the Project is out the door.
    As to the failure of the On-Line upload (nice, when it works), I would pour over your settings for that function. My guess would be that something (probably just one setting), is not right.
    It could be something that YouTube has changed, since you last used the function. They love to do that.
    Going back about a year (maybe longer?), when they went to Google accounts, almost everyone was left out in the cold, until they got their accounts sorted. Similar happened, when YouTube introduced the "extended accounts," but programs, like PrE had been written for the 10 min. Duration (why I asked for clarification on the Duration), so the direct upload function in PrE would not allow for those extended accounts. YouTube always seems to be a "moving target."
    Last, I am greatly honored! Thank you.
    Good luck,
    Hunt

  • The legal status of the fonts packaged with the trial version of CS5.5 after expiry

    Greetings,
    This is basically a question of conscience: I recently had the 30 day trial version of CS5.5, and was surprised to find that after the trial expired the fonts included in the demo package did not “self destruct” but continued to be available on my system. Does this mean that I can legitimately keep them on my computer (strictly for personal use)? The situation seems somewhat paradoxical – I can’t imagine Adobe simply giving these fonts away, yet I also can’t imagine them expecting people to hunt the fonts down and delete them independently once the trial period runs out. (Obviously they hope people will buy the full product, but unfortunately that proved not to be an option for me at the moment.) I didn't see anything about this in the initial terms and conditions when installing the trial package and cannot find any official stance on this in the documentation, so unless I missed something, it would seem that Adobe has no ground to ask people to manually remove the fonts in this situation. I would appreciate your advice.

    Adobe is not giving those fonts away.
    If you decide not to purchase a license to an Adobe product after installing and using the trial, you have no legal right to use the font after the trial period is over.
    Yes, the removal of those fonts was not accounted for but that doesn't change their legal status.
    Unfortunately, there are two problems associated with killing the ability to use the fonts after the trial period is over:
    (1)     We don't automatically uninstall the software after the trial period is over. We simply don't let you run it via the activation mechanism which blocks the execution. However, fonts are not involved in the activation mechanism (at least not currently) and as such, when the trial is over, the fonts are still installed and accessible by other programs. We would need to get the fonts into the activation mechanism somehow to be able to control their use when either a trial is over or the software is otherwise uninstalled!
    (2)     Currently, the Adobe fonts are installed into the system fonts directory. We would need to be careful to keep track of whether the user already had licenses to such fonts prior to installing a trial of Adobe software and not mucking with their status afterwards.
              - Dov

  • Can't find the adapters in communication channel

    Hi
    I can't find the adapters in communication channel , on hunting the sdn i could find the below soln :
    To rectify this you must import the BASIS SWCV 7.0 into the Integration repository.
    can any body give me step by step for importing in the integration repository.
    rgds
    shazia

    Hi,
    First do SLDCHECK in XI ABAP Stack, then if it has errors means follow this help file
    http://help.sap.com/saphelp_nw04s/helpdata/en/78/20244134a56532e10000000a1550b0/frameset.htm
    If SLDCHECK is working fine means,
    Try to re-import the BASIS SWC into IR againg, then only you will be able to see the list of adapters in the list..
    Regards
    Seshagiri

  • Not seeing all the files on a shared Windows server??

    I'm using a Windows Server 2003 to share files between Macintosh an Windows users. But sometimes the Mac users (10.4) don't see all the files (in the same folder) that the Windows users do! I've checked on the server and I don't see any (obvious) permission problem ... So why aren't all the files displayed???
    Any help is greatly appreciated!
    Jerome

    Hello Herr Jerome, I have the same problem, here in our company. We have around 70 employees connected to a windows server network. There are 68 PCs and 2 macs, one of which is mine. We have a special directory on the server called macdata, but other users place their files in their own respective directories, to which we normally have access.
    Since yesterday, if anyone else places files from PC on to the server for me, I cant see them. I can see all other files but not the ones copied since yesterday.Our support guys have tried pretty much everything including resetting permissions, to no avial. finally they received an error message: Caution older mac systems will have problems reading more than 65000 (plus a few files). But there are in advance of 100 000 files on our server, but the extra 35 000 wernt put on there just yesterday.I´m running Macosx 10.4.11 which is by no means an old system.
    I´ve spent the day hunting the Internet for a solution, but Info on this subject seem to be scarce! I mean this is a very big problem in a business environment, our IS dept has been trying to scrap the macs for years and I´ve been working here on a mac and fighting for 15 years. So now our IS has at last a valid reason for switching us to PCs.
    I don´t understand Apple not publishing these limitions in a prominent spot on their website, not to mention a solution because it´s a crucial limitation, people should know about. Apple truely is not interested in corporate, nor in its truly loyal champions bravely fighting aganst the PC onslaught

  • I Have Accidentally Put My System Folder In The Trash...

    Hello,
    One day i was cleaning up my harddrive when i think i may have accidentally dragged my system folder to the trash can. At which point i shut down the computer. Now i went to restart the computer and a panic screen pops up and i cannot load into my os. i already tried force loading the start up cd and that don't work. i heard there is a fix for this i can't find it though. is there a way to fix this? Im ok with losing my data I would actually prefer to lose it.
    Help Much Appreciated,
    Hunt The Mac!
    (Ibook G4 (10.4.11) PPC)
    Just To Let You Aware I Have Other Computers If That Helps

    What other computers do you have? If you have another Mac with FireWire, you could try starting up in FireWire Target Disk Mode with the iBook G4 as the target disk. This will mount the iBook's hard drive on the other Mac and you should be able to access the iBook's hard disk from the other Mac and drag the System Folder out of the Trash and back to where it belongs.

  • Hunt Group Queues

    We are evaluating moving from an Avaya 8710 based enterprise PBX to a Cisco PBX. A sticking point we have come accross is how to do basic phone features supported by the Avaya system. A major one is the ability to queue calls in a hunt group. We have sites that have up to 3 or 4 hunt groups and if a call comes in and all members in the hunt group are not available then the call goes to Music on hold until the call can be picked up by the next available in the hunt group.
    Is this really a limitation in Call Manager 5.x, 6.x or CME 4.3?

    To answer your question about IPCC express, I know it used to be free with CallManager 4.x, not sure with 5.x and came with 5 licenses. But with IPCCx, you can do just about anything you want when it comes to queing, onhold, music, transfers, etc.
    But from looking at the doc I sent you:
    Understanding Call Queuing
    You can configure a pilot point to support call queuing, so when a call comes to pilot point and all hunt groups members are busy, Cisco CallManager Attendant Console sends calls to a queue. While in the queue, the callers receive music on hold if you have chosen an audio source from the Network Hold Audio Source and the User Hold MOH Audio Source drop-down list boxes in the Device Pool window or the Pilot Point Configuration window. The attendants cannot view the queued calls. When a hunt group member becomes available, Cisco CallManager Attendant Console redirects the call to that hunt group member.
    You enable queuing for a pilot point by checking the Queuing Enabled check box on the Pilot Point Configuration window. You must also enter a value in the Queue Size field and the Hold Time (in Seconds) field. The queue size specifies the number of calls that are allowed in the queue. If the queue is full, Cisco CallManager Attendant Console routes calls to the "always route" hunt group member that is specified on the Hunt Group Configuration window. If you do not specify an always route member, Cisco CallManager Attendant Console drops the call when the queue size limit is reached. The hold time specifies the maximum time (in seconds) that Cisco CallManager Attendant Console keeps a call in the queue. If the call is in the queue for longer than the "HoldTime," the call gets redirected to "AlwaysRoute" member. If the "AlwaysRoute" member is not configured, no action occurs.
    This is saying that the CCM Attendant Console will take care of what you need. It's basically a big queing machine. You dont have to have a live person answer to start the que from what it looks like, just point the calls to the pilot number and let the server take control of the ques.
    You can do this one ccm cluster, or hub and spoke in your case. Just remember, that if you are queing calls, you are tying up WAN bandwidth the more you que. But it may work out ok, depending on how much bandwidth you have.
    You can get MOH streams off your local router at the remote site, so you are not streaming MOH over the WAN, so that should take care of itself.
    Unity can act as a poor man's que. Basically you can have ccm hunt the groups, no one answer, go to Unity voicemail, play a message, transfer back to the hunt group, hunt the group, then possibly back to Unity to play a message, then take a message. (just using a different mailbox and a different pilot number)
    Sometimes you have to get creative with these products to make them do what you want them to do. Out of the box, it's not always the exact feature you need, but you have to tweak it.
    Most companies that use hunt groups, understand that they are basica in CCM until you port it to IPCC Express. Unity does do menu trees very well, multilevel voicemail, multiply extesnsions to one account, etc.
    My best advice for you, get together with your local Cisco SE to go over the features you require and see how it can be done.
    cheers!

  • Missing Widgets: The light is on but no one is home

    Since my upgrade to 10.5.6 (at least that is the only significant event i can think of) all my widgets have gone missing. Well they are there, somewhere... but they are no longer visible. It's as if they are somehow off the screen somewhere. I know they are still there because i can see all the property files for them in prefs, and those with an audible cue still make their noises.
    I've tried resizing the display resolution in the hope that the widgets might get re-jigged. I've tried hunting the forums for people with similar problems but no luck.
    Is there someway of forcing the widgets into the visible area of the display? Are there some properties i could adjust in prefs to move these hidden widgets into the centre of the screen? Am going nuts.
    Any help much appreciated.

    modius wrote:
    Thanks for the pointer to the dashboard prefs file. Simply removing it got rid of all my existing widgets, so I opened up the old prefs file and had a look at changing the properties. For some reason all of the x/y values for my widgets were -30,000 to -110,000. Changing them to something like 100/100, saving and logging back in, put all my old friends back in the middle of my screen.
    Happy now
    you shouldn't have had to do that. removing the preference file didn't really remove your widgets. You just have to add them to the dashboard. start dashboard and click on the + in the lower left corner. all your widgets are listed at the bottom.

Maybe you are looking for