Simple Hangman Game

Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Aug 2008
Posts: 16
Reputation: Lil' Tripsturr is an unknown quantity at this point 
Solved Threads: 0
Lil' Tripsturr Lil' Tripsturr is offline Offline
Newbie Poster

Re: Simple Hangman Game

 
0
  #21
Aug 23rd, 2008
^^alright thanx
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 16
Reputation: Lil' Tripsturr is an unknown quantity at this point 
Solved Threads: 0
Lil' Tripsturr Lil' Tripsturr is offline Offline
Newbie Poster

Re: Simple Hangman Game

 
0
  #22
Aug 26th, 2008
have found a really interesting ,but simple hangman game on the net but i am really confused to how it actually works ,i would like to re-create it for myself but first i would need to understand it.it seems to use complicated code ,but there is much of it and the creator hasnt labeled all the pieces of code so it doesnt help.If u cud help me to disect the code then id be grateful .

The most confusing part of the code is how the creator actually got the letter and characters to appear like they do.Also would you be able to explain "CheckChar" ,"String$","UCase" , "Call" and "QuestionHandler"

http://www.sendspace.com/file/a4wye8

thanx
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 304
Reputation: aktharshaik is an unknown quantity at this point 
Solved Threads: 37
aktharshaik's Avatar
aktharshaik aktharshaik is offline Offline
Posting Whiz

Re: Simple Hangman Game

 
0
  #23
Aug 26th, 2008
Hi!
String$ is used to output a string by the specified length for the given character in the second parameter.

Ex:

text1.text = String$(10,"*")

will fill the textbox with ten *

Regards
Shaik Akthar
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 304
Reputation: aktharshaik is an unknown quantity at this point 
Solved Threads: 37
aktharshaik's Avatar
aktharshaik aktharshaik is offline Offline
Posting Whiz

Re: Simple Hangman Game

 
1
  #24
Aug 26th, 2008
UCASE Converts the given string to uppercase.


Ex
Dim x as string
x = "America"
text1.text = UCase(x)

here text1 will display the word in variable x but in upper case "AMERICA"

Regards
Shaik Akthar
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 304
Reputation: aktharshaik is an unknown quantity at this point 
Solved Threads: 37
aktharshaik's Avatar
aktharshaik aktharshaik is offline Offline
Posting Whiz

Re: Simple Hangman Game

 
0
  #25
Aug 26th, 2008
Call keyword is used to call any procedure by its name but its purely optional

like u can write

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Call txtGuess_Change

or just

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. txtGuess_Change

Regards
Shaik Akthar
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 16
Reputation: Lil' Tripsturr is an unknown quantity at this point 
Solved Threads: 0
Lil' Tripsturr Lil' Tripsturr is offline Offline
Newbie Poster

Re: Simple Hangman Game

 
0
  #26
Aug 26th, 2008
^^ok so u dont need to use it ???thats good thanx.
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 16
Reputation: Lil' Tripsturr is an unknown quantity at this point 
Solved Threads: 0
Lil' Tripsturr Lil' Tripsturr is offline Offline
Newbie Poster

Re: Simple Hangman Game

 
0
  #27
Aug 27th, 2008
can someone please explain "ChkChar"???I will rep.

ALSO

would someone please be able to tell me how to make code for the game so that it counts the number of correct guesses,for this game.I know that a label will need to be used etc.

http://www.sendspace.com/file/a4wye8

and for

Hangman.zip http://www.daniweb.com/forums/attach...1&d=1218656270
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 16
Reputation: Lil' Tripsturr is an unknown quantity at this point 
Solved Threads: 0
Lil' Tripsturr Lil' Tripsturr is offline Offline
Newbie Poster

Re: Simple Hangman Game

 
0
  #28
Aug 28th, 2008
still unsolved!!!check the above problem,there have been nearly 1000 views and no-1 can help me??I will rep if someone helps with this LAST problem!!!
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 304
Reputation: aktharshaik is an unknown quantity at this point 
Solved Threads: 37
aktharshaik's Avatar
aktharshaik aktharshaik is offline Offline
Posting Whiz

Re: Simple Hangman Game

 
1
  #29
Aug 28th, 2008
'Posi ' variable is used to track as when to move to the next line to print the body or arms or legs of the hangman.

when 'Posi' is 2 (i.e) when 2nd wrong guess is made, the '|' character must go to next line. hence 'Posi' is checked and if it is 2 a new line (vbCrLf) is appended.

Similarly when 'Posi' is 3 again we have to move to the next line to start the hands.
and when 'Posi' is 6 we have to move to the next line to start the legs.

Finally when 'Posi' is 8 (i.e) the hangmans last leg is to be displayed, then will be the end of the guesses because man hanging is complete with the last leg.

This is the point where the user is failed to guess the correct answer.

CheckChar function is used to check if the character typed in the guess box is present in the string pertaining to the 'intQuestionNumber'th value in the array. if not the guess is wrong. hence clear the Guess TextBox and go for the next try. If all tries are over i.e. 'Posi' is reached 8 as said above the game is lost. if before the 'Posi' reaches 8 the string the Question label with '_' matches the 'intQuestionNumber'th value in the array, the game is won.

Also u can count the wins and losses also.

Take 2 global integer variables and make then equal to 0 during form load.
One for Win Count and one for Lost Count.
The sum of these two will be Played Count.

Check out the attachment i have modified.

Some other suggestions
================
1. Change the words now and then
or
2. increase the number of words
or
3. put the strings in a text file and read the values from them

No 3. is better because u need not compile ur project again and again whenever u change the words.



Regards
Shaik Akthar
Attached Files
File Type: zip hangmanNew.zip (7.0 KB, 11 views)
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC