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?

這篇文章有幫助嗎?

 列印本文

Also Read

Setup extra mailserver for newsletters

Posted by dream_th, 06-29-2008, 12:22 PMHi, I have problems to express with my english but i...

brand new cpanel issue

Posted by ub3r, 01-15-2008, 12:24 AMWe got this email tonight, thought i'd share along with the...

yum broken

Posted by chielsen, 12-18-2007, 02:20 PMI have waisted all not trying to get subversion working...

lxadmin dns template

Posted by paul-naama, 09-15-2007, 06:36 PMhello all. i just signed up for a new vps host...

Voxtreme Resellers

Posted by BARNE, 09-05-2002, 02:16 PMI am looking at Voxtreme for setting up a resellers account...