none
how many numbers can i get RRS feed

  • Question

  • hi all,

    i want ask for something i don't really know and i'd like to do

    now I have a random number up to  3 digits 1,2,3 or 7,8,3 or 6,3,7 any 3 digits 

    i need to get a list of random numbers like this

    0

    1

    2

    00

    01

    02

    10

    11

    12

    20

    21

    22

    000

    010

    011

    111

    100

    110

    111

    i can't code that 

    can anyone help


    Wednesday, February 28, 2018 9:56 PM

All replies

  • You'll have to try to better explain what you want.  Just showing a list of numbers "like this" leaves too much guessing on our part.  Please describe in words what you want to do.

    Reed Kimble - "When you do things right, people won't be sure you've done anything at all"


    Wednesday, February 28, 2018 10:02 PM
    Moderator
  • hi all,

    i want ask for something i don't really know and i'd like to do

    now I have a random number up to  3 digits 1,2,3 or 7,8,3 or 6,3,7 any 3 digits 

    i need to get a list of random numbers like this

    0

    1

    2

    00

    01

    02

    10

    11

    12

    20

    21

    22

    000

    010

    011

    111

    100

    110

    111

    i can't code that 

    can anyone help


    Hi HossamVSVB.NET,

    You said that you want to have a random number up to  3 digits 1,2,3 or 7,8,3 or 6,3,7 any 3 digits, what does it mean?

    Then you said that you want to get a list of random numbers like this, you just want to get these data into list?

    Please describe more detailed info.

    Best Regards,

    Cherry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, March 1, 2018 1:37 AM
    Moderator
  • Hi,

    Sorry, if I can misunderstand what you want to achieve.
    And I'm afraid you are a student and it is a school assignment. If this is correct or not, you should learn how to provide your requirements to others.

    This is a sample by my supposition.
         

    [code: VB.NET]
    Private Sub btn_GenerateRandom_Click(sender As Object, e As EventArgs) Handles btn_GenerateRandom.Click
    	Me.txt_Random.Text = ""
    	' ---
    	For idx As Integer = 1 To CInt(Me.txt_LoopCount.Text)
    		Dim mySeed As New System.Random(idx)
    		Dim myRand As Integer _
    			= mySeed.Next(CInt(Me.txt_Min.Text), CInt(Me.txt_Max.Text))
    		Me.txt_Random.Text += myRand & vbCrLf
    	Next
    End Sub

    Regards,

    Ashidacchi

    Thursday, March 1, 2018 3:04 AM
  • Sorry for everyone
    I was just thinking about whether I could make a list of words that could be typed in the keyboard
    These words start from a word containing a single letter or number until it reaches 16 characters or a number
    And insert them into a listbox
    I will create a program that requires this list
    So that we enter the program a number of letters or numbers or signs and the program writes all possible possibilities

    Thursday, March 1, 2018 1:35 PM
  • Sorry for everyone
    I was just thinking about whether I could make a list of words that could be typed in the keyboard
    These words start from a word containing a single letter or number until it reaches 16 characters or a number
    And insert them into a listbox
    I will create a program that requires this list
    So that we enter the program a number of letters or numbers or signs and the program writes all possible possibilities
    Thursday, March 1, 2018 1:36 PM
  • You did not understand me yet
    I want them to arrange
    Thursday, March 1, 2018 1:39 PM
  • Sorry for everyone
    I was just thinking about whether I could make a list of words that could be typed in the keyboard
    These words start from a word containing a single letter or number until it reaches 16 characters or a number
    And insert them into a listbox
    I will create a program that requires this list
    So that we enter the program a number of letters or numbers or signs and the program writes all possible possibilities

    Are you trying to generate a list of permutations?  If so, one or more of the answers in these threads may be helpful.

    https://social.msdn.microsoft.com/Forums/en-US/home?forum=vbgeneral&sort=relevancedesc&brandIgnore=True&searchTerm=get+all+permutations


    Reed Kimble - "When you do things right, people won't be sure you've done anything at all"

    Thursday, March 1, 2018 4:27 PM
    Moderator
  • You did not understand me yet
    I want them to arrange

    Letters and numbers arrange differently if you you a List(Of T) for strings. You would need a List(Of T) for integers so numbers would arrange correctly.

    And then to write code to arrange letters and numbers, up to 16 digits or letters in length is entirely another issue as well not repeating the original arrangement.

    3 digits would be 3 to the 2nd power or 6 possibilities, 4 to the 3rd, etc on to 16 to the 15th or 1,152,921,504,606,846,976 possibilities I believe for 16 characters. At some point a ListBox will not be able to display the permutations prbably around 65,535 or so. Try figuring out the mathematical possibilities before deciding on an idea like this. I don't know how long a PC would take to perform 1,152,921,504,606,846,976 possibilities but longer than you would want to wait for that to occur probably. Unless you have access to the NSA's supercomputers maybe.


    La vida loca

    Tuesday, March 6, 2018 3:51 AM