Here's my code. Sorry for the awful conventions, but they are meant to be like this.
What I'm trying to do is add a random String from charlie(), and add it to applepicked().
If applepicked already has the the String chosen, it will choose a different String.
It will loop until the length of the array is 5.
There is my horrible attempt.
Can someone please fix it up?
At the moment it's not adding the strings to the new array
Code:
Public Function charliebrown() As String
Randomize()
Dim charlie() As String = New String() {"billyboy", "shoppingmall", "cookingtime", "halfbaked", "benandJerrys", "alaska", "northernstates", "america", "loltakethat!"}
Dim picked As String = charlie(Rnd)
For count = 0 To applepicked.Length - 1
For counter = 0 To charlie.Length - 1
While applepicked.ToString.Contains(picked) = False And applepicked.Length <> 5
applepicked(count) = picked
End While
'Return applepicked(Rnd)
Next
Next
End Function
If applepicked already has the the String chosen, it will choose a different String.
It will loop until the length of the array is 5.
There is my horrible attempt.
Can someone please fix it up?
At the moment it's not adding the strings to the new array