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

I dont want the users to click on teh letters they are choosing. They are inputing in a textbox and I need to see if it is in the randomly choosen word from the database. How do u compare if the letter they inputed is in which position and replace it where it should go? Also how do u make the shape of the hangman show up if they get it wrong? Please help

2007-03-19 12:06:53 · 1 answers · asked by ひいらぎ 5 in Computers & Internet Programming & Design

1 answers

Look up the function "InStr" in help - that's the function you'll use, it's short for "In String".

Dim letter as String
Dim word as String

word = "Happy"
letter = "a"

Msgbox Instr(letter, word)

Will popup "1", meaning a is in character position 1. If I flubbed up the syntax or exact function, I'm sorry - I'm doing this off the top of my head - but look up Instr, it's easy to use.

As for the hangman, I'd recommend finding a picture on the net and using MS Paint to break it up into 5-6 pieces and then use ImageBoxes to display the pieces. Make all the boxes invisible and each time the user makes a bad guess, make 1 of the boxes visible.

The user loses when all are visible.

GOod luck.

2007-03-19 12:19:33 · answer #1 · answered by vbslinger 2 · 0 0

fedest.com, questions and answers