Results 1 to 7 of 7

Thread: Hangman

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2002
    Posts
    7

    Lightbulb Hangman

    Does anyone have any cunning plans for how I could make a basic single player hangman game in VB? I would like to be able to draw random words from a text file for it.

  2. #2
    ChuckB
    Guest
    Cunning? Don't know about that. Your program presents three problems (easy to solve).

    First: Graphics...drawing a man can be done using the LINE control and the SHAPE control. Place them on a form the way you want the 'stickman' to look. Once designed set the ENABLED property of each of these to false so they will not be seen on the form. To test, add Command button so when it is clicked one body part at a time is enabled. You may use a variable that has an initial value of 0. Increment this with button click. Use SELECT CASE to decide what body part to enable as the value increases.

    Second: Loading word. Build text file with some sample words. Write routine to read this file (add Random load after program is working) Search the forum for the 'how to...?' I am sure this has been answered before. As the form loads, have a word automatically read from file and loaded into variable.

    Third: As a person enters a letter, use the INSTR command to see if the letter is in there. If so, create a new variable with those letters...using spaces for letters not yet solved. MID( ) will work well here. Each incorrect guess enables another body part to be added.

    Is this cunning or just boring?

    Good luck,

  3. #3
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Well

    My post won't be as long...

    http://209.120.143.185/showthread.ph...hreadid=181309

    Guess there's alot of teacher's preaching the same word...
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

  4. #4
    ChuckB
    Guest

    VB Hangman w/ VB word list

    Hi,
    I went ahead and wrote this little Hangman program tonight that has over 60 VB specific words/properties/functions in a word file. I will modify it for my children. It is compact and looks pretty neat.

    I have provided error handling for the file load operation. Have fun. There is a really cool bug. Take a look and let me know how you fix it.

    Regards,
    ChuckB
    Attached Files Attached Files

  5. #5
    Member 110359's Avatar
    Join Date
    Jun 2002
    Location
    Melbourne, Australia
    Posts
    43
    Interesting game Chuck.
    Why is it that when you kill one man people call you a murderer and when you kill one thousand you are a conqueror?

  6. #6
    Not NoteMe SLH's Avatar
    Join Date
    Mar 2002
    Location
    192.168.0.1 Preferred Animal: Penguin Reason for errors: Line#38
    Posts
    3,051
    ChuckB, is the error the fast drawing of the man, when holding down? If so, you could just have a button to click, for guessing a letter, then run the check code in the click event, instead of in the listbox change event.
    Quotes:
    "I am getting better then you guys.." NoteMe, on his leet english skills.
    "And I am going to meat her again later on tonight." NoteMe
    "I think you should change your name to QuoteMe" Shaggy Hiker, regarding NoteMe
    "my sweet lord jesus. I've decided never to have breast implants" Tom Gibbons
    Have I helped you? Please Rate my posts.


  7. #7

    Thread Starter
    New Member
    Join Date
    Jun 2002
    Posts
    7
    thanks chuck B

Posting Permissions

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



Click Here to Expand Forum to Full Width