Guess Number

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cathf
    New Member
    • Feb 2007
    • 1

    #1

    Guess Number

    I am working on a program where the user guesses a random number generated in VB. The numbers entered by the user must be within the range 1 to 20, so the program has been validated. All valid guesses have to be counted and this is where I am having problems. Any ideas?
  • avdbrink
    New Member
    • Feb 2007
    • 12

    #2
    Can't you put them entered numbers into an array.
    Somthing like:

    Code:
    ReDim Preserve ArrayOfNumbers(UBound(ArrayOfEnteredNumbers) + 1)
    ArrayOfEnterednumber(UBound(ArrayOfEnteredNumbers)) = EnteredNumber
    This way you can loop through the array to see if a number is already guessed before...

    Hope it helps
    Last edited by willakawill; Feb 21 '07, 07:25 PM. Reason: please use code tags when posting code

    Comment

    • willakawill
      Top Contributor
      • Oct 2006
      • 1646

      #3
      What have you come up with so far?

      Comment

      • TNT
        New Member
        • Feb 2007
        • 48

        #4
        Originally posted by cathf
        I am working on a program where the user guesses a random number generated in VB. The numbers entered by the user must be within the range 1 to 20, so the program has been validated. All valid guesses have to be counted and this is where I am having problems. Any ideas?
        Just do it so that if the guess is between 0 and 20, it adds 1 on to a Global Variable.

        Comment

        Working...