I'm wondering how I could tell VB to pick a random number 1-12. I'm making a multiplication game where VB picks 2 numbers between 1 and 12 and tells the user if he/she is correct. I need help on the random numbers part
Random Numbers!
Started by PascalPro, Apr 02 2008 03:51 PM
4 replies to this topic
#1
Posted 02 April 2008 - 03:51 PM
|
|
|
#2
Posted 02 April 2008 - 08:56 PM
So basically what you are wanting the program to do is pick a random number and assign that number between 1 and 12 and assign it to a variable, then have the program tell the user if it matches the user's input?
That is the code just for generating the random number between 1 and 12. If you need help with any other part of the code just ask.
Dim random as New Random dim num as integer num=random.next(1,13)
That is the code just for generating the random number between 1 and 12. If you need help with any other part of the code just ask.
#3
Posted 03 April 2008 - 01:31 PM
Please read the rules how to ask for help:
http://forum.codecal...p-properly.html
Please edit your post accordingly and another time stick to the rules.
http://forum.codecal...p-properly.html
Please edit your post accordingly and another time stick to the rules.
#4
Posted 08 August 2008 - 05:42 AM
How do u keep the random number the same until it is guessed correctly
#5
Posted 08 August 2008 - 01:23 PM
Make it a global variable (dim random outside the random function).
Option Explicit
:cool:
:cool:


Sign In
Create Account


Back to top









