HELP!!!

I have this project on Java. URGENT.
It involves the use of the pps keyboard input and basically its about writing a game application that is able to run in DOS and in a GUI interface...

Any way here is the question:
This game is a version of "hunt the wumpus", one of the earliest computer adventure games
You will be in a system of 8 dark caves, each connected to three other caves
The caves are inhabited by 1 (ONE) wumpus
This is a creature which smells horribly and will eat you if you walk into its cave
you will lose
The caves also have 1 (ONE) bottomless, slimy pit
If you walk into its cave, you will fall in
you will lose
You are armed with 3 arrows
If you shoot into the cave with a wumpus, you will kill it and win
If you shoot into any other cave you will lose your arrow
You can exit the game when given the chance, this means you lose
Do you want to play hunt the wumpus? (y/n)
You are in a system of dark and gloomy caves
Your current location is cave number 4
To your left, ahead, and to your right there are tunnels to
caves numbers 7, 0, 5
You can smell the characteristic horrible smell of wumpus
You can hear and feel a cold and eerie wind
What will you do?
To walk enter w, to shoot enter s, to exit the game enter e
where to? (enter number of one of the neighbouring caves)
7
You have fallen into the bottomless pit
Do you want to play again? (y/n)
You are in a system of dark and gloomy caves
Your current location is cave number 4
To your left, ahead, and to your right there are tunnels to
caves numbers 7, 0, 5
You can smell the characteristic horrible smell of wumpus
What will you do?
To walk enter w, to shoot enter s, to exit the game enter e
where to? (enter number of one of the neighbouring caves)
0
The wumpus was not in that cave, you now have 2 arrows.
You are in a system of dark and gloomy caves
Your current location is cave number 4
To your left, ahead, and to your right there are tunnels to
caves numbers 7, 0, 5
You can smell the characteristic horrible smell of wumpus
What will you do?
To walk enter w, to shoot enter s, to exit the game enter e
where to? (enter number of one of the neighbouring caves)
7
The wumpus was not in that cave, you now have 1 arrows.
You are in a system of dark and gloomy caves
Your current location is cave number 4
To your left, ahead, and to your right there are tunnels to
caves numbers 7, 0, 5
You can smell the characteristic horrible smell of wumpus
What will you do?
To walk enter w, to shoot enter s, to exit the game enter e
where to? (enter number of one of the neighbouring caves)
5
Congratulations - you have killed the wumpus
Do you want to play again? (y/n)
y
w
y
s
s
s
n
Total games played: 2
Games won by user: 1
Games lost by user: 1
because user was eaten: 0
because user fell in the pit: 1
because user quit: 1

--- Basically I have to write the code for this in Java.

I have done most of it but there are some flaws --- By the way you need CodeWarrior to run the program.

Here is my code:

import java.awt.*;
import java.awt.event.*;
import pps.*;
import pps.Keyboard;

public class WGame extends PPSFrame implements ActionListener
{
private boolean debugging;
WBot gamePlay = new WBot();

private TextField dataEntry;
private TextArea response;
private Label dataLabel;
char walk = 'w';
char shoot = 's';
char exit = 'e';
int walkPos, shootPos, curCave;
char userinput;
int arrows = 3;

public WGame()
{
super();
debugging = false;
//explain();

setSize(470,400);
setTitle("Hunt the Wampus");

Panel dataPanel = new Panel();
dataPanel.setLayout(new BorderLayout());

dataEntry = new TextField(30);
dataPanel.add(dataEntry, "South");

response = new TextArea(5,45);

dataLabel = new Label("Where to:");
dataPanel.add(dataLabel, "Center");

Panel buttonPanel = new Panel();
Button enter = new Button("Enter");
enter.addActionListener(this);

Button cancel = new Button("Cancel");
cancel.addActionListener(this);

add(dataPanel);
add(enter);
add(cancel);
add(response);

show();

char start = 'y';

start = Keyboard.readChar("Do you want to play the game?");

while(start != 'n')
{
if(userinput != 'e')
{
play();
}
else
{
break;
}
}
}


public void actionPerformed(ActionEvent e)
{


}



public void play()
{




System.out.println("You are now in a system of dark and gloomy caves");

if (curCave <=0)
{
gamePlay.setUp(0);
curCave = gamePlay.newGame();
}

System.out.println("Your current location is cave number, " +gamePlay.getCurrent());
System.out.println("To your left, ahead, and to your right there are tunnels to caves numbers "
+ gamePlay.nextCave('l') + "," +gamePlay.nextCave('a')+ "," +gamePlay.nextCave('r'));

if(gamePlay.wumpusNear())
{
System.out.println("You can smell the characteristics horrible smell of wumpus");
}

if(gamePlay.pitNear())
{
System.out.println("You can hear and feel a cold and eerie wind");
}
userinput= Keyboard.readChar("To walk enter w, to shoot enter s, to exit the game enter e");


if(userinput == 'w')
{


walkPos = Keyboard.readInt("where to? (enter the number of the neighbouring caves)" );
int result = gamePlay.tryWalk(walkPos);

if(result < 21)

if(result == 10)
{
System.out.println("You have been eaten by a Wumpus");
}
else
{
if(result == 20)
{
System.out.println("You have fallen into a bottomless pit");
}
else
{
System.out.println("This is not a successful move Jedi");
}
}
else
{
System.out.println("This is impossible");
}


}else
if(userinput == 's')
{


shootPos = Keyboard.readInt("where to? (enter the number of the neighbouring caves)" );
int resultshoot = gamePlay.tryShoot(shootPos);
arrows --;

if(resultshoot < 21)
{
if(resultshoot == 1)
{
System.out.println("Congratulations - you have killed the wumpus");
}
else
{
if(resultshoot == 0)
{
System.out.println("The wumpus was not in that cave, you now have " +arrows+ " arrows");
}
}

}
else
{
System.out.println("This is impossible");
}

if(arrows == 0)
{
System.out.println("You can not shoot anymore, run like a chicken");
}




}
else{
System.out.println("Thanks you for playing HUNT the WUMPUS");
}




//start = Keyboard.readChar("Do you want to play the game?");
}


public void paint(Graphics g)
{
debug("explain the game");
g.drawString("This game is a version of hunt the wumpus, one of the earliest computer adventure games",10 ,200);
g.drawString("You will be in a system of 8 dark caves, each connected to three other caves",10, 215);
g.drawString("The caves are inhabited by 1 (ONE) wumpus\n",10, 230);
g.drawString("This is a creature which smells horribly and will eat you if you walk into its cave",10, 245);
g.drawString("you will lose",10, 260);
/*g.drawString("The caves also have 1 (ONE) bottomless, slimy pit\n" +
g.drawString("If you walk into its cave, you will fall in\n" +
g.drawString("you will lose\n" +
g.drawString("You are armed with 3 arrows" +
g.drawString("If you shoot into the cave with a wumpus, you will kill it and win" +
g.drawString("If you shoot into any other cave you will lose your arrow" +
g.drawString("You can exit the game when given the chance, this means you lose");*/
}

public void debug(String message)
{
if(debugging)
{
System.out.println("Wgame: " + message);
}
}
}


Thanks all...