Important alert: (current site time 7/16/2013 1:37:22 AM EDT)
 

VB icon

!!!*!Make a cool EASY Lotto Game!*!!!

Email
Submitted on: 8/6/1999
By: SeeD  
Level: Not Given
User Rating: By 15 Users
Compatibility: VB 3.0, VB 4.0 (16-bit), VB 4.0 (32-bit), VB 5.0, VB 6.0
Views: 53526
(About the author)
 
     MAKE AN EASY LOTTO GAME!!! ***UPDATED***
 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.
				
'**************************************
' Name: !!!*!Make a cool EASY Lotto Game!*!!!
' Description:MAKE AN EASY LOTTO GAME!!! ***UPDATED***
' By: SeeD
'
' Inputs:You're going to need 3 Labels to start. You can add more once you get the hang of it. You also need 1 Command button. Make it's caption "OK", and the Labels captions blank. Follow the simple instructions below.
'
' Assumes:You can alter this code to your convienience. Here are some nifty things you could change:
 You could use text boxes instead of labels. You would have to change every "Label1.Caption" to "Text1.Text" and so on.
 
 You can add as many more text boxes or labels as you'd like, as long as you adjust the code accrodingly.
 If your smart enough, you could make it a simple password entry screen, but you'd have to do some easy error handling and you'd have to use text boxes instead of labels.
 If your smart enough, you could make a simple lotto game to share with your friends and family. - SeeD (o:
'
'This code is copyrighted and has' limited warranties.Please see http://www.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=2841&lngWId=1'for details.'**************************************

Private Sub Command1_Click()
 Label1.Caption = Int(rnd * 10)
 Label2.Caption = Int(rnd * 10)
 Label3.Caption = Int(rnd * 10)
If (Label1.Caption = Label2.Caption) And (Label3.Caption = Label2.Caption) Then
 MsgBox "You Win!", 8, "Winner!"
End If
End Sub


Other 32 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Not Given category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments

8/6/1999 1:33:00 PMSeeD

there are no limits as of what you could do with an RNG (Random Number Generator) Have Fun! (o:
(If this comment was disrespectful, please report it.)

 
9/16/1999 9:07:00 PMWolf

You have to seed the Rnd function with Randomize otherwise you get the same random numbers over and over.
(If this comment was disrespectful, please report it.)

 
3/20/2000 9:41:48 PMBurbble

yep, you have to put Randomize in it otherwise it will give the same (random) numbers each time the program runs. another (sad) program by what's his face...
(If this comment was disrespectful, please report it.)

 
7/29/2001 5:07:09 PMSeeD

yep yep yep. demonstrates how to use random numbers. Also, please stick "Randomize" into form_load.
(If this comment was disrespectful, please report it.)

 
10/5/2001 8:12:21 PMLance

Seed, you didn't think of this. If you did then you and a book company have somthing in common. This is an example called Lucky seven in a book..thanks
(If this comment was disrespectful, please report it.)

 
11/13/2001 2:14:43 PMvorticon

your obviously a beginner i have made a better one than that and yes you must seed the random numbers on randomizer.
(If this comment was disrespectful, please report it.)

 
4/20/2002 5:31:09 AMthe one

good example of random number generating just dont forget to leave out randomize
(If this comment was disrespectful, please report it.)

 
1/2/2003 7:03:40 PMEvil Karma

This is C rap, you didnt make this. Ive seen this on a vb tutorial cd. Its one of the first things you make. Go make something of your OWN O.o Newba
(If this comment was disrespectful, please report it.)

 
2/26/2003 1:15:38 PMStanky Cheese

screw all of u that said this code sucked >:O this code was AWESOME! last night my riend showed my it and im like "woah!!!!!!!" i think u did an excellent job on this seed! one thing for everyone that doesnt kno alot about rnd, its a random number between 0 and .99999999999999999999999999999
(If this comment was disrespectful, please report it.)

 
3/3/2003 2:04:56 PMJames Dunne

Err this is begginers work. Its probably the first things you make ('cept for that popup alert with "Hello World" on it XD)
(If this comment was disrespectful, please report it.)

 
6/21/2003 2:22:24 PM

this code is in the vb step by step book. just like a few people have stated. not very nice to take credit for something you didnt do.
(If this comment was disrespectful, please report it.)

 
2/22/2004 4:04:52 PM

Not a good idea to steal code from the Microsoft Press writer Michael Halvorson, Writer in part of the book "Step By Step Microsoft Visual Basic 6.0 Professional", Found on pages 19 - 49 are the instructions on how to make the program and how it works. The project can also be found on the Sample CD found with it. Looks like he missed the info on the bottom of page 45 that states that you should put in a Seed to keep the random numbers totaly random. This is proof that he stole the code for Lucky 7 and posted it up here. This breaks at least 2 copyright laws, and makes him look bad. Tisk Tisk...
(If this comment was disrespectful, please report it.)

 
3/15/2004 10:46:44 AMguptashubham123

Great !!!
(If this comment was disrespectful, please report it.)

 
3/15/2004 10:47:38 AMguptashubham123

Great !!!

(If this comment was disrespectful, please report it.)

 
9/21/2005 8:12:08 AMDONT OPEN

lol a stolen code... report him to police ;)
(If this comment was disrespectful, please report it.)

 
6/8/2006 10:47:13 AMRey

Kinda useful program for beginers, I advanced it but I can't show on this comment, quite big xD
(If this comment was disrespectful, please report it.)

 
11/1/2007 11:11:17 AMvivek

project on vb
(If this comment was disrespectful, please report it.)

 
6/19/2008 12:31:49 AM-kraiz-

you guys are all cruel, he's just trying to share with other new beginners, if you have nothing better to say than "he stold it" then please do not reply..........by the way, great example, it can be useful for some beginners
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.