|
-
Oct 29th, 2010, 11:10 PM
#1
Thread Starter
New Member
Telephone Number word Generator (plz plz help)
I am trying to make telephone number word generator, user enters phone number 7 digits between 2 to 9 and then it generates all possible word combinations,
it should be 3 ^ 7 = 2187
please help me im new to vb.net plz thks
Dim phoneNumber As String = GetNumber()
'check if the number contains 0 or 1
While phoneNumber.Contains("0") Or phoneNumber.Contains("1")
phoneNumber = GetNumber()
End While
'create a hashtable to hold the digits
Dim arrayL As New Hashtable
Dim x As Integer = 1
For i As Integer = 65 To 90 Step 3
arrayL.Add(x, New Char() {Chr(i), Chr(i + 1), Chr(i + 2)})
x += 1
Next
Dim word As String = ""
Dim counter As Integer
'creates only 3 words out of the phonenumber
For i As Integer = 0 To 2
For Each s As String In phoneNumber
word = word & DirectCast(arrayL.Item(CInt(s)), Char())(i).ToString
Next
output = (counter & "" & vbNewLine)
Next
End Sub
Private Sub PhoneNumberTextBox_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
Phonenumber = Phonenumber
End Sub
Private Function GetNumber() As String
Return Phonenumber
End Function
End Module
plz help ....
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|