Here is what I have so far...
Random rand= new Random();
String hidden="XXXXXXX";
String word="";
int count=1;
while(count==1)
{
int subCount=rand.nextInt(5);
if(subCount==0)
{
word="ornament";
}
else if(subCount==1)
{
word="chimney";
}
else if(subCount==2)
{
word="reunion";
}
else if(subCount==3)
{
word="snowman";
}
else if(subCount==4)
{
word="present";
}
else if(subCount==5)
{
word="holiday";
}
String s=JOptionPane.showInputDialog("Enter a letter guess: ");
if(word.contains(s))
{
}
}
I think that is what I'm suppose to do, so if it is, I don't know what to put under the if statement to replace any letters.

New Topic/Question
Reply




MultiQuote








|