|
-
Dec 23rd, 2009, 01:20 AM
#1
Thread Starter
New Member
-
Dec 23rd, 2009, 02:09 AM
#2
Re: A random word generator?
Whenever you want something random in VB, you are pretty much always going to use a Random object. You call Next on that object to get a random Integer in a range, then use that Integer in whatever way is appropriate. In your case, that would mean indexing an array or collection containing all you words.
-
Dec 23rd, 2009, 02:21 AM
#3
Re: A random word generator?
Big deal! I'm only 16 yet I know the language semi-decently.
What you're asking is quite similar to how you'd do it in LUA. I won't program this for you, instead I'll do a bit of Psuedo-Code.
Code:
Declare Array of Words() [Call it Words()]
Declare Random Object [Call it RNM]
Declare Integer [Call it i]
i = RNM.Next()
Declare Current Word [call it CurrWord]
CurrWord = Words(i)
There you go. Something like that.
-
Dec 23rd, 2009, 03:56 AM
#4
Thread Starter
New Member
Re: A random word generator?
I finished my gen. It generates random passwords. I didn't say that because I was worried you guys would take it wrong. Lol
-
Dec 23rd, 2009, 04:08 AM
#5
Thread Starter
New Member
Re: A random word generator?[resolved]
Here is the file: (you probably won't find it useful. But its one of my first programs ever wrote)
Even made a icon for it. I feel so special lol.
-
Dec 23rd, 2009, 04:12 AM
#6
Thread Starter
New Member
Re: A random word generator?[resolved]
Aw. Apparently its a invalid file. Here's the media fire link:
http://www.mediafire.com/?nmlgdnkzmzv
-
Dec 23rd, 2009, 07:26 AM
#7
Hyperactive Member
Re: A random word generator?[resolved]
Hi Turtleman,
Just an idea:
You could use Chr or Chrw with a random number to get random characters. Example:
This would generate 10 different characters:
Code:
Dim random As New Random
Dim password As New Text.StringBuilder
For i As Int32 = 0 To 9
password.Append(Chr(random.Next(65, 90)))
Next
MsgBox(password.ToString)
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
|