Well need a easy code but I dont know what to do:
I need to generate a random number like this:
![[Image: b0748d24e8ea2d05bdf2deb078ce7e5d.png]](https://i.gyazo.com/b0748d24e8ea2d05bdf2deb078ce7e5d.png)
What I can put there? 19 numbers
I need to generate a random number like this:
![[Image: b0748d24e8ea2d05bdf2deb078ce7e5d.png]](https://i.gyazo.com/b0748d24e8ea2d05bdf2deb078ce7e5d.png)
What I can put there? 19 numbers
|
.NET
generate a random number |
|
Mar 13, 2017 11:35 AM
(This post was last modified: Mar 13, 2017 11:35 AM by Barret.)
PHP Code
Mar 13, 2017 06:02 PM
(This post was last modified: Mar 13, 2017 06:03 PM by BoliBerrys.)
Code const string numbers = "0123456789";EDIT: I just realized this is the VB section and not the C#, so my code is useless to you. (Mar 13, 2017 06:02 PM)BoliBerrys Wrote: you lil fucker replicated my version :P hahahaha 🤣
Mar 13, 2017 09:35 PM
(This post was last modified: Mar 13, 2017 09:39 PM by BahNahNah.)
Heres how i would do it:
Code Dim r As New Random()And heres a short verson for the lols Code Function GetRandomNumberString(len As Integer) As String
Lotta blood to let, peace to make, give a fuk about a check
(Mar 13, 2017 07:29 PM)Barret Wrote: you lil fucker replicated my version :P hahahaha 🤣 No idea what u coded haha Sorry if its basically the same 😭😭 (Mar 14, 2017 06:09 PM)BoliBerrys Wrote: No idea what u coded haha Dont sweat it, nothing is ever owned, everything is copied of something. Heck even nature does that. :P (Mar 14, 2017 07:25 PM)Barret Wrote: Dont sweat it, nothing is ever owned, everything is copied of something. Heck even nature does that. :P some one "your" level should know NEVER initialize the random class multiple times. (Mar 14, 2017 07:35 PM)Sn0wX Wrote: some one "your" level should know NEVER initialize the random class multiple times. Its static. There is only one instance.
Lotta blood to let, peace to make, give a fuk about a check
Urgh child's time.
Static cant use different seeds. It's not thread safe. This is basic GOOD CODING STANDARDS. but hey when you guys use so many single instances in your apps i would expect you to carry THEM. oh wait you do not. You wouldn't be able to use different seeds if it were static - the Random instance keeps track of that state. By default Random uses the current time as seed
Mar 15, 2017 05:08 PM
(This post was last modified: Mar 15, 2017 05:09 PM by BahNahNah.)
(Mar 15, 2017 04:47 PM)Sn0wX Wrote: Urgh child's time. What are you talking about? Objects are reference types, the sttaic var just stores the pointer to the random Instance.
Lotta blood to let, peace to make, give a fuk about a check
|
|
|
| Possibly Related Threads... | |||
| Thread / Author | Replies | Views | Last Post |
| [C] by MaskinApr 21, 2021 01:52 AM | 5 | 326 |
Apr 21, 2021 01:52 AM Last Post: Vector Dynamics |
| [C] by Tr0jandogJul 18, 2020 12:05 AM | 4 | 224 |
Jul 18, 2020 12:05 AM Last Post: Xora |
| [C#] by draxyeeDec 28, 2019 03:44 PM | 2 | 294 |
Dec 28, 2019 03:44 PM Last Post: Eternal Darkness |