Lost Password?

Go Back   CodeCall Programming Forum > Software Development > Visual Basic Programming

Visual Basic Programming Discussion forum for Visual Basic, an event driven programming language and associated development environment from Microsoft for its COM programming model.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-02-2008, 06:51 PM
PascalPro PascalPro is offline
Newbie
 
Join Date: Mar 2008
Posts: 9
Rep Power: 0
PascalPro is on a distinguished road
Default Random Numbers!

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 04-02-2008, 11:56 PM
RagedSparrow's Avatar   
RagedSparrow RagedSparrow is offline
Newbie
 
Join Date: Apr 2008
Location: Mocksville, NC
Age: 22
Posts: 9
Rep Power: 0
RagedSparrow is on a distinguished road
Send a message via Skype™ to RagedSparrow
Default Re: Random Numbers!

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?

Code:
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-03-2008, 04:31 PM
TcM's Avatar   
TcM TcM is offline
Moderator
 
Join Date: Aug 2006
Location: In a technologic world :p
Posts: 7,339
Rep Power: 66
TcM has much to be proud ofTcM has much to be proud ofTcM has much to be proud ofTcM has much to be proud ofTcM has much to be proud ofTcM has much to be proud ofTcM has much to be proud ofTcM has much to be proud of
Default Re: Random Numbers!

Please read the rules how to ask for help:
[READ HERE] How To Ask For Help Properly

Please edit your post accordingly and another time stick to the rules.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 08-08-2008, 08:42 AM
CDubb CDubb is offline
Newbie
 
Join Date: Aug 2008
Posts: 5
Rep Power: 0
CDubb is on a distinguished road
Default Re: Random Numbers!

How do u keep the random number the same until it is guessed correctly
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 08-08-2008, 04:23 PM
o0TheNerd0o's Avatar   
o0TheNerd0o o0TheNerd0o is offline
Learning Programmer
 
Join Date: Sep 2007
Location: I.E. So-cal
Age: 22
Posts: 61
Rep Power: 4
o0TheNerd0o is on a distinguished road
Send a message via AIM to o0TheNerd0o
Default Re: Random Numbers!

Make it a global variable (dim random outside the random function).
__________________
Option Explicit
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Request] Numbers Programm! pormadori Visual Basic Programming 4 03-15-2008 01:03 PM
Encryption using Random!? TcM Programming Theory 14 01-07-2008 10:48 AM
Generating Random Numbers with PHP Paradine PHP Tutorials 4 08-27-2007 07:09 PM
Random Generator of Unequal Numbers Paradine PHP Tutorials 0 08-26-2007 02:11 PM
Return random numbers without duplicates Paradine PHP Tutorials 0 08-26-2007 02:07 PM


All times are GMT -5. The time now is 02:10 AM.

Contest Stats

John ........ 223.00000
dargueta ........ 168.00000
Xav ........ 164.00000
LogicKills ........ 20.00000
sam ........ 20.00000
gaylo565 ........ 18.00000
|pH| ........ 15.00000
WingedPanther ........ 15.00000
Johnnyboy ........ 3.00000
navghost ........ 1.00000

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 67%

Ads