First, you want to place the following on your new form
- 2 buttons
- 4 labels
So, first you want to rename the following buttons and labels.
- Rename button1 to "Spin"
- Rename button2 to "End"
- Rename label1-3 to "0"
- Label 4 to "Lucky Seven"
Now, your forum or application will look like mine:
Once you have done that you want to double click the "Spin" button. Now, for the coding of the spin button you want to type
This makes it generate a random integer and make it times itself by 10. And the int part removes the decimals that the number has in the end when it is generated and the cstr(convert to string) converts it into text and puts it in your label1-3 text boxes.Code:Label1.Text = CStr(Int(Rnd() * 10)) Label2.Text = CStr(Int(Rnd() * 10)) Label3.Text = CStr(Int(Rnd() * 10))
Now, what you want to do is double click the "end" button this code is very simple.
The end code means for it to end the application/forum.Code:End
Now, save your project and your finished.
Results 1 to 5 of 5
Thread: [VB.NET]Lucky Seven Game.
- 15 Dec. 2009 12:13am #1
[VB.NET]Lucky Seven Game.
Last edited by iFresh; 28 Dec. 2009 at 01:43am.
- 15 Dec. 2009 01:26pm #2
Random number generator? Needs to check if you won for it to be a game.
- 15 Dec. 2009 03:14pm #3
- 21 Dec. 2009 12:15am #4
- Age
- 30
- Join Date
- Nov. 2009
- Location
- Anaheim, California
- Posts
- 1,065
- Reputation
- 99
- LCash
- 200.00
Real lucky seven has a dampening device that statistically generates winning numbers under a mathematical percentage.
Basically the casino set's the machine to only win with a 40% or 70% chance and then generates numbers, really you are playing to lose but statistically if you watch the machine all day you can win every-time ;P (But they watch very closely for this.)
That's why they have sign's like; "60% chance of winning!" because there is really a 60% chance based on how many number's etc. have been previously generated after the last win.
These machines are extremely hightech, and the mathematics behind it are kept secret but general knowledge.
What I'm saying is it's just not that cut and dry, the machine will take the amount of close win's before your pull and calculate based on the previously generated numbers whether or not you are going to win as you pull the lever. It's actually very unfair, but you are the one paying for it.Last edited by Chris; 21 Dec. 2009 at 12:18am.
- 21 Dec. 2009 12:45am #5
Moved to programming tutorials.
Nice guide.