English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

My friend really needs help with this. And I have no idea what any of it is, so if any one could help out in any way, I would really appreciate it!!!

Or if you have a good website too, that would be great. There are no helpful websites out there, at least not one that we've found yet.

So if you know how to make Hangman with Visual Basic, please respond. Thank you! ^_^

2006-12-18 14:48:22 · 1 answers · asked by Kalia 4 in Computers & Internet Programming & Design

1 answers

You would by chance have Prof Pricilla Grocer at BCC would you. I had the same problem.

Psuedo Code:

Create an array (0 to 25) to hold the alphabet .
Have a list of words in a text file, one on each line
Read each word in the file into an array (myWords()) you can either set up a fixed array of words or do a redim preserve as you add new words. Either way you need to know how many words are loaded in the array. Use a counter as you add into a fixed array or a Ubound(myWords) function to determin the upper limit

Create two string variables myHiddenWord, and myDisplayWord

Generate a random number to select one of the myWord elements and assign to myHiddenWord

Count the number of letters in the word
Assign that number of underscores to myDisplayWord

Assign myDisplayWord to a lable for viewing on a form

As each letter is guessed remove it from the letters array
Scan mydisplayWord for a match
For each match replace the underscore with that letter in myDisplayWord
redisplay the updated myDisplayWord

If no match count as error

2006-12-18 17:02:09 · answer #1 · answered by MarkG 7 · 1 0

fedest.com, questions and answers