CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: GAME

  1. #1
    Join Date
    Feb 2000
    Location
    South Africa
    Posts
    3

    GAME

    Hi,
    Please send the VB 5.0 code and form layout for the following game:
    Write a program in which the computer selects a random number(between 0 and 10 ) and the player needs to guess what the number is. Check if the number is too low too high or incorrect.Reply to [email protected]
    Thanks in advance
    meera


  2. #2
    Join Date
    Feb 2000
    Location
    Indiana
    Posts
    308

    Re: GAME

    This looks an awful lot like you want someone to do your homework for you . Here's some information that will get you where you need to go:
    1) Select Random number between two other numbers.Int((upperbound - lowerbound + 1) * Rnd + lowerbound)

    (This was straight out of the help file)
    2) Determine whether the guess is the same, higher, or lower than the target number:

    Select Case guess
    Case target
    'The number is the same
    'Do whatever you need done
    Case < target
    'The guess is less than target
    'Do something to tell user
    Case > target
    'The guess is greater than target
    'Do something to tell user
    End Select



    This is everything you need to complete your project.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured