VB question

Posted by hopesfall, 03-10-2010, 12:42 AM
I have a string of asterisks "*****" which are in variable1. The asterisks are there to hide the real word "doggy", which are held in variable2. When a user enters a letter into a text box, lets say "g", how can I check for the letter "g" inside my variable2 and also replace the asterisks in the corresponding spots so that it shows "**gg*" instead?

Posted by mattle, 03-10-2010, 12:24 PM
Writing a hangman game, are we? Let's break it down to the elements: 1. Capture the user input. Validate as alpha. 2. Get an array of character positions where the user-entered character matches variable2. Track whether or not the character matches at all (possibly by evaluating array size). 3. If character matches, go through position array and change the chars at each position in variable1, redraw variable1 4. If character doesn't match, increment wrong guess counter, take appropriate action. Without more specifics, it's hard to give you any more info. Is this a web page, a console app, etc.? What technologies are you using?

Bu cevap yeterince yardımcı oldu mu?

 Bu dökümanı yazdır

Also Read

Drop-down header (yahoo like?)

Posted by coume, 03-13-2010, 07:40 AMHello, I struggled to find the right title for the thread...

Mysql query LIKE%

Posted by net4all, 03-12-2010, 05:32 AMI got a special mysql-problem: I have a table containing...

how i can stoped nailswebd

Posted by osayd, 06-29-2008, 07:06 PMHi, i need to stoped nailswebd then enable it in my server...

Problems with mod_security on CentOS 64

Posted by TheMatrix, 06-28-2008, 11:41 PMHello- I've been having the hardest time getting...

How can I fix this?

Posted by TylerH, 09-18-2008, 06:06 AMFor some reason my sendmail is not working and I tired...