![]() |
![]() |
#1 (permalink) |
Upright
|
Java-Hangman
Hi I am currently taking a basic Java programing class and for our final grade we were told to design a game of some sort. I am doing hang man and am more lost than words can describe. If anyone has the program or a version of the program please post it because I need all the help i can get! if i don't get an A in this class than i am losing my scholarship so please please please help!!! We use the 2007 J builder program if that makes a diffrence
|
![]() |
![]() |
#2 (permalink) | |
Tilted Cat Head
Administrator
Location: Manhattan, NY
|
__________________
I don't care if you are black, white, purple, green, Chinese, Japanese, Korean, hippie, cop, bum, admin, user, English, Irish, French, Catholic, Protestant, Jewish, Buddhist, Muslim, indian, cowboy, tall, short, fat, skinny, emo, punk, mod, rocker, straight, gay, lesbian, jock, nerd, geek, Democrat, Republican, Libertarian, Independent, driver, pedestrian, or bicyclist, either you're an asshole or you're not. |
|
![]() |
![]() |
#3 (permalink) |
Asshole
Administrator
Location: Chicago
|
Step one - call your professor.
Step two - ask for help. Step three - do your own damn work. Repeat as necessary.
__________________
"They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." - B. Franklin "There ought to be limits to freedom." - George W. Bush "We have met the enemy and he is us." - Pogo |
![]() |
![]() |
#5 (permalink) |
Tilted Cat Head
Administrator
Location: Manhattan, NY
|
so wait? you can't complete your assignment, you come to our community and say that if you don't get the help you'll lose your scholarship, so we should help you since that's the best interest of you...
and you call two admins assholes because we want you to do your own work?
__________________
I don't care if you are black, white, purple, green, Chinese, Japanese, Korean, hippie, cop, bum, admin, user, English, Irish, French, Catholic, Protestant, Jewish, Buddhist, Muslim, indian, cowboy, tall, short, fat, skinny, emo, punk, mod, rocker, straight, gay, lesbian, jock, nerd, geek, Democrat, Republican, Libertarian, Independent, driver, pedestrian, or bicyclist, either you're an asshole or you're not. |
![]() |
![]() |
#7 (permalink) |
I have eaten the slaw
|
You asked for a program, not a suggestion.
__________________
And you believe Bush and the liberals and divorced parents and gays and blacks and the Christian right and fossil fuels and Xbox are all to blame, meanwhile you yourselves create an ad where your kid hits you in the head with a baseball and you don't understand the message that the problem is you. |
![]() |
![]() |
#8 (permalink) | |
Found my way back
Location: South Africa
|
There's a big difference between asking for help and asking to have your work done for you. What kind of reply were you expecting - "Here, double-click on this and the program runs..." ?
If you want help, you explain (in detail) what you have done and where you're stuck. You list all the things you've tried and what the results were. Don't come in here looking for complete apps on a plate. Regards, Mature Adult
__________________
Quote:
|
|
![]() |
![]() |
#9 (permalink) |
Tilted Cat Head
Administrator
Location: Manhattan, NY
|
Thanks healer.
You could even post the code you've written for us to look at troubleshoot and give pointers as to where your program is problematic. Instead, you've asked us for the whole enchilada with arrogant entitlement. .
__________________
I don't care if you are black, white, purple, green, Chinese, Japanese, Korean, hippie, cop, bum, admin, user, English, Irish, French, Catholic, Protestant, Jewish, Buddhist, Muslim, indian, cowboy, tall, short, fat, skinny, emo, punk, mod, rocker, straight, gay, lesbian, jock, nerd, geek, Democrat, Republican, Libertarian, Independent, driver, pedestrian, or bicyclist, either you're an asshole or you're not. |
![]() |
![]() |
#10 (permalink) |
Asshole
Administrator
Location: Chicago
|
If you'd said "hey, I don't understand one part of this assignment. Can someone explain it better?" I would have helped if I could.
You asked me to do your work for you. Then you called me an asshole because I refused to aid your lazy ass, but still provided a way for you to find a way to get it done. Nice first impression, kid. Maybe you want to try that again, this time without that chip on your shoulder.
__________________
"They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." - B. Franklin "There ought to be limits to freedom." - George W. Bush "We have met the enemy and he is us." - Pogo |
![]() |
![]() |
#11 (permalink) |
Wise-ass Latino
Location: Pretoria (Tshwane), RSA
|
Now I'm disappointed. I thought there'd be a cool Hangman Java app in this thread.
__________________
Cameron originally envisioned the Terminator as a small, unremarkable man, giving it the ability to blend in more easily. As a result, his first choice for the part was Lance Henriksen. O. J. Simpson was on the shortlist but Cameron did not think that such a nice guy could be a ruthless killer. -From the Collector's Edition DVD of The Terminator |
![]() |
![]() |
#13 (permalink) |
Upright
|
Heres what ive got sofar
Here is what I have so far. Please don't be rude this time, and instead help me. I am seriously stuck. The program reads in from a file containg 4 letter words : Cake, Play, Bank, Ball, Dogs, Cats, Meow, Beer, Bear, Cars, Lamp. The program needs to check the word vs the guess and keep track of the number of incorrect guesses.
import java.util.*; import java.io.*; public class hangman { public static void main(String [] args) throws IOException { getHeading (); startHangman (); } public static void getHeading () throws IOException { System.out.println(“Hi folks how are you today? Hope your day is going swell!”); System.out.println(“Today we are going to play the game of Hangman!”); System.out.print(“You will be given 5 tries before the game is over”); System.out.print(“ and the man has been fully hanged.”); System.out.println(“Let’s get started!”); } public static void startHangman () throws IOException { int maxTries = 5; int secretWordLen; BufferedReader infile; Infile = new BufferedReader (new FileReader (“HangmanList.txt”)); String wordlist = fileScan.next(); String secretWord [] = wordlist[(int)Math.floor(Math.random() * wordlist.length)]; secretWordLen = Math.min(s.length(), maxWordLen); for (i=0; i<secretWordLen; i++) { secretWord[i] = s.charAt(i); } String Response; System.out.println(“What is your name”); Response = in.readLine(); Response = new name; hangPlayer = new player(name); System.out.println(hangPlayer); } } private class player { private player(String name) { int winCount = 0; int loseCount = 0; System.out.print(name + (", you have won " + winCount + " and you have lost ") + loseCount); return name; } } |
![]() |
![]() |
#18 (permalink) |
DOOMTRAIN
Location: NC
|
I've done this before years ago. Mine wasn't limited to 4 letter words though. I will not write any program for you or give you mine, but I will explain as best as I can what you need to do (from my recollection). I'm also assuming that you are given the GUI.
When you get the word that is to be the "secret word", store it into an array. I would also suggest that you turn each letter into lower case. Make a second array and fill it with 4 underscores. This array is what will be displayed on the GUI. Now, when the user types in a letter, compare it to each letter of the secret word array. It'll be easy since you only have 4 letters. You could just pound it out instead of using a while or for loop. If there's a match, just put that letter in the correct location of the underscore array. I don't remember anything about keeping track of letters already used, but my guess would be to set up another array that places the letters they type into it. Then just compare the next letter they type to the elements of that array. This one you'll probably need to use while/for loop. Also, on second thought, I didn't do this for java. It was another programming class that I have no recollection of. But, this will work. And, your program so far looks pretty empty.
__________________
SIGNATURE. |
![]() |
![]() |
#19 (permalink) | |
The Computer Kid :D
Location: 127.0.0.1
|
Quote:
Honestly, I'm an engineering student, and I'm taking a pretty rough 2000-level crash course in C++ and it's gone far over my head. I really have always underestimated how hard "good" programming is, and how rare it is to find people that are really brilliant when it comes to making applications in C++. Just keep me at entry-level scripting and stuff ... I can tear it up at excel, but object-oriented programming is out of my league. I'm almost glad I took this course, because now I now for sure I don't want to be a CS major, ever. Maybe functional stuff like Common Lisp / Scheme will help. |
|
![]() |
Tags |
hangman, java |
|
|