Menu
Menu
DaniWeb
Log In
Sign Up
Read
Contribute
Meet
Search
Search
About 15 results for
hangmangame
- Page 1
Help with hangman tutorial.
Programming
Software Development
17 Years Ago
by wicked357
… the output, you may find that the
HangmanGame
and HangmanMenu methods are not being called. Why… *argv[]) { HangmanMenu myMenu("hangman.txt");
HangmanGame
myGame(myMenu); Controller myController(myGame); myController.start(); // Start…with the menu, and confirm the correct method
HangmanGame
::play() is being invoked when you choose (…
NullPointerException when importing classes please help
Programming
Software Development
12 Years Ago
by ladybirdchance
…(FRAME_WIDTH, FRAME_HEIGHT); containerPanel = new JPanel(); WordGenerator myWord = new WordGenerator();
HangmanGame
game = new
HangmanGame
(myWord.getWord()); createWordField(); createImagePanel(); createLetterPanel(); createButtonPanel(); createContainerPanel(); createMenuBar…
Re: NullPointerException when importing classes please help
Programming
Software Development
12 Years Ago
by radhakrishna.p
…class variable references as a instance variavbles as follows private
HangmanGame
game; private WordGenerator myWord; but those 2 references … of inside the constructor WordGenerator myWord = new WordGenerator();
HangmanGame
game = new
HangmanGame
(myWord.getWord()); as follows this.myWord = new WordGenerator();…
Need help with hangman game and array manipulation
Programming
Software Development
13 Years Ago
by uzii305
… is my code so far. Thanks is advance. [CODE] package
hangmangame
; import java.util.Scanner; import java.util.Random; import java….io.*; import java.util.*; import java.lang.*; public class
HangManGame
{ public static void main(String[] args) throws IOException { HangManStates states…
Re: Need help with hangman game and array manipulation
Programming
Software Development
13 Years Ago
by uzii305
… i add the '*' to the secretWord length array??? [CODE] package
hangmangame
; import java.util.Scanner; import java.util.Random; import java….io.*; import java.util.*; import java.lang.*; public class
HangManGame
{ public static void main(String[] args) throws IOException { HangManStates states…
Re: NullPointerException when importing classes please help
Programming
Software Development
12 Years Ago
by harinath_2007
Your title to the post looks odd. you dont get any nullpointer exception when you try to import any class. If a class is not found , then you'll get NoClassFound Exception. Maybe you are trying to accessing a object which has 'null' value. Try to figure out yourself , as this is a runtime excepiton, you dont know unless you go through your code …
Re: NullPointerException when importing classes please help
Programming
Software Development
12 Years Ago
by bguild
Tracking down the cause of a `NullPointerException` is a simple matter of looking at the top of the stack trace which indicates the exact place where a null pointer was encountered. If the top method isn't one that you wrote, then go down the stack until you find a method that you wrote, but in this case you wrote the method at the top of the stack…
Re: NullPointerException when importing classes please help
Programming
Software Development
12 Years Ago
by ladybirdchance
Yea, that was the problem. Didnt realise I had done something so silly. Works perfect now. Thanks For the help everyone :)
Re: Need help with hangman game and array manipulation
Programming
Software Development
13 Years Ago
by stultuske
well, you have two Strings: 1. your original word 2. a String the same length as your original one filled with *'s. you print the second one. whenever you guess a char, you verify with the original String if the char is in there, and if so, check the indexes of where, and at that same index, you change the char in your *'s char to that char.
Re: Need help with hangman game and array manipulation
Programming
Software Development
13 Years Ago
by zeroliken
[QUOTE=stultuske;1782870]well, you have two Strings: 1. your original word 2. a String the same length as your original one filled with *'s. you print the second one. whenever you guess a char, you verify with the original String if the char is in there, and if so, check the indexes of where, and at that same index, you change the char in your *'s…
Re: Need help with hangman game and array manipulation
Programming
Software Development
13 Years Ago
by uzii305
[QUOTE=stultuske;1782870]well, you have two Strings: 1. your original word 2. a String the same length as your original one filled with *'s. you print the second one. whenever you guess a char, you verify with the original String if the char is in there, and if so, check the indexes of where, and at that same index, you change the char in your…
Re: Need help with hangman game and array manipulation
Programming
Software Development
13 Years Ago
by uzii305
What is the syntax of indexof()??
Re: Need help with hangman game and array manipulation
Programming
Software Development
13 Years Ago
by uzii305
I got the first part thank you guys im working on checking userInput char with array secretWord. Any hints on possible algorithms would be appreciated. Thank you guys. You're awesome.
Re: Need help with hangman game and array manipulation
Programming
Software Development
13 Years Ago
by zeroliken
Just thought up on an alternative(better in my opinion) solution in checking if a letter input exists. Loop the string index and compare each character using charAt() method then change the index of the secret word with the letter input, you could use the StringBuilder class setCharAt() method to change the specified index with the letter If your …
Re: Need help with hangman game and array manipulation
Programming
Software Development
13 Years Ago
by uzii305
Thanks boss. Greatly appreciated.
Search
Search
Forums
Forum Index
Hardware/Software
Recommended Topics
Programming
Recommended Topics
Digital Media
Recommended Topics
Community Center
Recommended Topics
Latest Content
Newest Topics
Latest Topics
Latest Posts
Latest Comments
Top Tags
Topics Feed
Social
Top Members
Meet People
Community Functions
DaniWeb Premium
Newsletter Archive
Markdown Syntax
Community Rules
Developer APIs
Connect API
Forum API Docs
Tools
SEO Backlink Checker
Legal
Terms of Service
Privacy Policy
FAQ
About Us
Advertise
Contact Us
© 2025 DaniWeb® LLC