hangman source code

Sharky Forums


Results 1 to 14 of 14

Thread: hangman source code

  1. #1
    Sushi
    Join Date
    Mar 2004
    Posts
    4

    hangman source code

    can anyone provide me with a simple source code to make a hangman program using the BlueJ program? thanks

  2. #2
    NullPointerException rock's Avatar
    Join Date
    Sep 2000
    Location
    York, PA
    Posts
    6,203
    Lots of hangman source code around here.

    But what is BlueJ? That Java program to teach Java? Have you found this useful?

    Open Source is free like a puppy is free.

    It's only when you look at an ant through a magnifying glass on a sunny day that you realise how often they burst into flames.

    Understanding Evolution

  3. #3
    Catfish
    Join Date
    Oct 2000
    Location
    Twin Cities
    Posts
    116
    Looks like someone has a hangman assigment for school?

  4. #4
    Sushi
    Join Date
    Mar 2004
    Posts
    4
    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?

  5. #5
    Stormtrooper Mod Pinky's Avatar
    Join Date
    Oct 2000
    Posts
    2,971
    Moving to programming.

    Proofread carefully to see if you any words out.

    [the rules]

  6. #6
    Reef Shark darnimsexy's Avatar
    Join Date
    Jun 2003
    Location
    ummm...good question
    Posts
    393
    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.

  7. #7
    . ksuohio's Avatar
    Join Date
    Oct 2001
    Location
    Atlanta, GA
    Posts
    2,721
    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.
    ---------------------------------------------------------------
    - Asus M50 Laptop - C2D T9300 - 4 gig RAM - Radeon HD 3650 - Vista x64 Ultimate

    - Intel i7-3770K - Asus P8Z77-V DELUXE - 32gig RAM - Radeon HD7970 Ghz - Plextor M3 256GB/120GB OCZ Vertex3
    - LG BluRay - Razor Blackwidow Ultimate Keyboard - Logitech G9x
    - HP ZR2740w/Asus LCD - W7 Ultimate

    ---------------------------------------------------------------

  8. #8
    nuclear launch detected kpxgq's Avatar
    Join Date
    Jun 2001
    Location
    texas
    Posts
    16,612
    you should change your major
    bitfenix prodigy, i5 4670k, asrock z87e-itx, zotac gtx 970, crucial m500 msata, seasonic x650, dell st2220t

  9. #9
    NullPointerException rock's Avatar
    Join Date
    Sep 2000
    Location
    York, PA
    Posts
    6,203
    Originally posted by kpxgq
    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.

    Open Source is free like a puppy is free.

    It's only when you look at an ant through a magnifying glass on a sunny day that you realise how often they burst into flames.

    Understanding Evolution

  10. #10
    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?

  11. #11
    Catfish
    Join Date
    May 2003
    Location
    new york
    Posts
    214
    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.
    words.

  12. #12
    Tiger Shark UmneyDurak's Avatar
    Join Date
    Apr 2004
    Location
    Escaped from 2nd floor of Soda Hall.
    Posts
    671
    A bit of topic, but java started to make a whole lot more sence after I learned C.
    01+01=10

  13. #13
    Thread Killer Delphi00's Avatar
    Join Date
    Jun 2003
    Location
    Bay Area, CA
    Posts
    3,327
    funny thing we just had an assignment: hangman using java
    Rig:
    P4 2.4C @ 3.0Ghz | Abit IC7 | Thermalright SLK 947U + Enermax 90mm | Scythe Ultra Kaze 120mm | Corsair 3GB | PowerColor HD3850 AGP | Antec SLK3700AMB | Enermax Whisper II 535W | Hercules Fortissimo III 7.1 | Samsung 931B | Logitech Z-2300 | WinXP Pro

  14. #14
    Sushi
    Join Date
    Nov 2008
    Posts
    1

    hangman

    Quote Originally Posted by minimoose View Post
    can anyone provide me with a simple source code to make a hangman program using the BlueJ program? thanks
    How i can make a simple hangman game source code in java

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •