can anyone provide me with a simple source code to make a hangman program using the BlueJ program? thanks
Printable View
can anyone provide me with a simple source code to make a hangman program using the BlueJ program? thanks
Lots of hangman source code around here.
But what is BlueJ? That Java program to teach Java? Have you found this useful?
Looks like someone has a hangman assigment for school?
haha you guessed right my friend. it is a school assignment. no one in our class has any idea how to make the hangman dealie, and im not tryin to fail that class.
blueJ is a java program. ive never programmed before, so i dont know how it compares to other java programs. im really bad at it too, which is probably why i have a 56% in the class.
so could someone direct me to the place where i can find the source code?
Moving to programming.
simply have the word entered by one player letter by letter into a Vector or an array. Then have a for loop run to generate a number of *'s or _'s corresponding to the number of letters in the word. Then have it run a while loop with an if statement that keeps track of whether or not the person entered in a wrong value. When the player is prompted to select a letter simply search the array for the letter and return whether or not it's there.
Sit down and play hangman on paper and then put it into logic. The rules of hangman are very simple and any level of programmer should be able to do this. I would use an array for the word like mentioned above and a counter that is tested for number of wrong guesses.
you should change your major
Eh, if he's learning Java through BlueJ, he's probably not a comp sci major. Probably just a low-level elective on programming.Quote:
Originally posted by kpxgq
you should change your major
I hope u weren't tring to find the source code just to copy and paste it. That scares me. Try asking ur teacher for help?
As was suggested, develope an idea first, then put it into psuedocode, then worry about java.
The idea can be from playing a game, and noticing how the rules work. You know that a word, or String is a character array. Good news is if you get to use Java, plenty of stuff in the string api can make this a snap.
As far as user interface, if its not graphical, this program is even easier.
Write down in words, exactly what the program does. It's a good approach.
A bit of topic, but java started to make a whole lot more sence after I learned C.
funny thing we just had an assignment: hangman using java :)