Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

hangman game

807607Nov 6 2006 — edited Nov 6 2006
i need help creating a hangman game with a predefined array of words for a java assignment here is my code so far

input Textfield 1 "for inputing word letters"
int alltrys = 6; "allow 6 incorrect"
int nowrong =0;
char guess;
int guessnumbers;
boolean badGuess;
String[] words;

public void init (){
word = newString(20); "this is going to be my array of predefined words"
{
word(0) = "cardiff";
word(1) = "bluebirds";
word(2) = "ccfc";
word(3) = "goal";
word(4) = "alexander";
word(5) = "jones";
word(6) = "hamman";
word(7) = "ridsdale";
word(8) = "ninianpark";
word(9) = "bluearmy";
word(10) = "grandstand";
word(11) = "cantonstand";
word(12) = "grangeend";
word(13) = "bobbank";
word(14) = "wales";
word(15) = "city";
word(16) = "penalty";
word(17) = "shoots";
word(18) = "chopra";
word(19) = "ayatollah";

int w = rand.nextInt(20);
int randomNumber I = Math.random()*word.length);
for (int stringIndex = 0; stringIndex < word(i),length();stringIndex ++)
char.currrentCharacter
}

dont know if some is even right but am reccomended to also use

drawString()
drawOval()
drawLine()
TextField()
Button()


i am only new to java so really need help also using textpad to do java

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Dec 4 2006
Added on Nov 6 2006
7 comments
372 views