Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Reply
Old 06-29-2008, 02:25 PM My name generator.
Extreme Talker

Posts: 176
Trades: 0
I decided to try to make a name generator with asp:
http://bit-digita.com/other/namege.asp
I just want to know if you think It's coded right, because there are a couple of names that I keep seeing(Ayrno, Jerc, Gerlo, Earla) so it seems like something Is wrong.

Here is the code:
Code:
<%

Dim str1(24)
str1(0)="a"
str1(1)="b"
str1(2)="c"
str1(3)="d"
str1(4)="e"
str1(5)="f"
str1(6)="g"
str1(7)="h"
str1(8)="z"
str1(9)="j"
str1(10)="k"
str1(11)="l"
str1(12)="m"
str1(13)="n"
str1(14)="o"
str1(15)="p"
str1(16)="qu"
str1(17)="r"
str1(18)="s"
str1(19)="t"
str1(20)="y"
str1(21)="v"
str1(22)="w"
str1(23)="x"
str1(24)=""

Dim str2(5)
str2(0)="ar"
str2(1)="er"
str2(2)="ir"
str2(3)="or"
str2(4)="ur"
str2(5)="yr"

Dim str3(36)
str3(0)="a"
str3(1)="b"
str3(2)="c"
str3(3)="d"
str3(4)="e"
str3(5)="f"
str3(6)="g"
str3(7)="tan"
str3(8)="i"
str3(9)="ty"
str3(10)="k"
str3(11)="l"
str3(12)="m"
str3(13)="n"
str3(14)="o"
str3(15)="p"
str3(16)="q"
str3(17)="r"
str3(18)="s"
str3(19)="t"
str3(20)="u"
str3(21)="ve"
str3(22)="ton"
str3(23)="x"
str3(24)="y"
str3(25)="z"
str3(26)="no"
str3(27)="na"
str3(28)="ny"
str3(29)="to"
str3(30)="ta"
str3(31)=""
str3(32)="la"
str3(33)="le"
str3(34)="li"
str3(35)="lo"
str3(36)="ly"


randomize
stro1 = str1(Int(rnd*(int(UBound(str1))+1)))
randomize
stro2 = str2(Int(rnd*(int(UBound(str2))+1)))
randomize
stro3 = str3(Int(rnd*(int(UBound(str3))+1)))

newname=(stro1+stro2+stro3)
newname = UCase(Left(newname,1)) & Mid(newname,2)
response.write(newname)
%>
tell me if you see anything wrong, or know how to fix it
Skeddles is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 06-30-2008, 05:46 PM Re: My name generator.
Learning Newbie's Avatar
Defies a Status

Latest Blog Post:
Astounding Republican Paranoia
Posts: 5,662
Name: John Alexander
Trades: 0
I don't remember the default seed value for randomize?
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Learning Newbie is offline
Reply With Quote
View Public Profile
 
Old 06-30-2008, 06:39 PM Re: My name generator.
nyef's Avatar
Ultra Talker

Posts: 265
Name: Lucas
Trades: 0
You don't need to call randomize every time you generate a random number, just once at the top of the page.
__________________
~nyef

Please login or register to view this content. Registration is FREE
nyef is offline
Reply With Quote
View Public Profile Visit nyef's homepage!
 
Old 06-30-2008, 07:42 PM Re: My name generator.
Learning Newbie's Avatar
Defies a Status

Latest Blog Post:
Astounding Republican Paranoia
Posts: 5,662
Name: John Alexander
Trades: 0
And, now that I look at it, if you're asking for the same number of letters every time, that makes it a lot easier to get similar looking names!
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Learning Newbie is offline
Reply With Quote
View Public Profile
 
Old 07-01-2008, 08:15 PM Re: My name generator.
Sleeping Troll's Avatar
Ultra Talker

Posts: 351
Name: Butch Begy
Trades: 0
Doesn't really present a problem, but you should not need to use the Int function twice in each statement.

instead of:

stro1 = str1(Int(rnd*(int(UBound(str1))+1)))

try:

stro1 = str1(int(rnd*(ubound(str1))+1))
Sleeping Troll is offline
Reply With Quote
View Public Profile
 
Old 07-01-2008, 09:53 PM Re: My name generator.
nyef's Avatar
Ultra Talker

Posts: 265
Name: Lucas
Trades: 0
Should be cint() not int()...
__________________
~nyef

Please login or register to view this content. Registration is FREE
nyef is offline
Reply With Quote
View Public Profile Visit nyef's homepage!
 
Reply     « Reply to My name generator.
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.51318 seconds with 12 queries