Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Random Number Generator
#1
I need help with random number generator and the number has to about 15 digit for example like this 123456789012345. Any help will be appreciated
Support me by take tour to BPForums http://bit.ly/YTBCS1

Get More Views on youtubehttp://addm.cc/?WIZ01V
#2
Hi there i have a PDF that shows you how to make a LuckySeven game that uses random numbers - <!-- m --><a class="postlink" href="http://www.mediafire.com/view/?a4y5dv9ca2ey95e">http://www.mediafire.com/view/?a4y5dv9ca2ey95e</a><!-- m -->

Here is my conversion of that to 15 numbers <!-- sWink --><img src="{SMILIES_PATH}/icon_e_wink.gif" alt="Wink" title="Wink" /><!-- sWink -->

[Image: 51928726135042162511.png]
[Image: 16387.png]
#3
Cartman Wrote:Hi there i have a PDF that shows you how to make a LuckySeven game that uses random numbers - <!-- m --><a class="postlink" href="http://www.mediafire.com/view/?a4y5dv9ca2ey95e">http://www.mediafire.com/view/?a4y5dv9ca2ey95e</a><!-- m -->

Here is my conversion of that to 15 numbers <!-- sWink --><img src="{SMILIES_PATH}/icon_e_wink.gif" alt="Wink" title="Wink" /><!-- sWink -->

[Image: 51928726135042162511.png]
It would help if you give me the page number or a sample code
Support me by take tour to BPForums http://bit.ly/YTBCS1

Get More Views on youtubehttp://addm.cc/?WIZ01V
#4
manishshrestha60 Wrote:It would help if you give me the page number or a sample code

Chapter 2 --> Page 37 <!-- s:oops: --><img src="{SMILIES_PATH}/icon_redface.gif" alt=":oops:" title="Embarrassed" /><!-- s:oops: -->
[Image: 16387.png]
#5
Well, here's a quick code snippet that I crafted especially for you!

Since an integer can't hold something that is 15 characters long, we need to individually generate 15 random integers and insert them into a String. Like so,
[code2=vbnet]Dim randomNumberLength As Integer = 15
Dim randomNumberString As String = ""
For i As Integer = 1 To randomNumberLength Step 1
Randomize() 'Randomize the numberset
randomNumberString += CInt((Rnd() * 10)).ToString 'Generate a number from 0-9 and tack it onto String.
Next[/code2]

Hopefully this helps solve your problem. If you have any questions about this code, feel free to ask!

The variable randomNumberString is now your random number of randomNumberLength characters long.
My Blog | My Setup | My Videos | Have a wonderful day.


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to play random .wav files with a button click STrooper501 0 7,433 04-17-2013, 03:32 PM
Last Post: STrooper501
  auto generated number jochen29 3 14,249 10-01-2012, 02:52 PM
Last Post: brandonio21

Forum Jump:


Users browsing this thread: 1 Guest(s)