Random Name Generator (Carlos.R edition)


#1
*temp myrandomname "?"
*temp lengthlimit 0
*temp letterzero "?"
*temp letter1 "?"
*temp letter2 "?"
*temp letter3 "?"
*temp letter4 "?"
*temp letter5 "?"
*temp letter6 "?"
*temp letter7 "?"
*temp letter8 "?"
*temp letter9 "?"
*temp letter10 "?"
*temp randomletter 0

*label randomnamegen
[b]Random Name Generator[/b]

*choice
 #Pick a random name (3 letters long)
  *set lengthlimit 3
  *goto naming
 #Pick a random name (4 letters long)
  *set lengthlimit 4
  *goto naming
 #Pick a random name (5 letters long)
  *set lengthlimit 5
  *goto naming
 #Pick a random name (6 letters long)
  *set lengthlimit 6
  *goto naming
 #Pick a random name (7 letters long)
  *set lengthlimit 7
  *goto naming
 #Pick a random name (8 letters long)
  *set lengthlimit 8
  *goto naming
 #Pick a random name (9 letters long)
  *set lengthlimit 9
  *goto naming
 #Pick a random name (10 letters long)
  *set lengthlimit 10
  *goto naming



*label naming
*if lengthlimit = 3
 *gosub alphabet
 *set letter1 letterzero
 *gosub alphabet
 *set letter2 letterzero
 *gosub alphabet
 *set letter3 letterzero
 *set myrandomname (letter1 & letter2) & letter3
 *goto myname

*if lengthlimit = 4
 *gosub alphabet
 *set letter1 letterzero
 *gosub alphabet
 *set letter2 letterzero
 *gosub alphabet
 *set letter3 letterzero
 *gosub alphabet
 *set letter4 letterzero
 *set myrandomname (letter1 & letter2) & (letter3 & letter4)
 *goto myname

*if lengthlimit = 5
 *gosub alphabet
 *set letter1 letterzero
 *gosub alphabet
 *set letter2 letterzero
 *gosub alphabet
 *set letter3 letterzero
 *gosub alphabet
 *set letter4 letterzero
 *gosub alphabet
 *set letter5 letterzero
 *set myrandomname ((letter1 & letter2) & (letter3 & letter4)) & letter5
 *goto myname

*if lengthlimit = 6
 *gosub alphabet
 *set letter1 letterzero
 *gosub alphabet
 *set letter2 letterzero
 *gosub alphabet
 *set letter3 letterzero
 *gosub alphabet
 *set letter4 letterzero
 *gosub alphabet
 *set letter5 letterzero
 *gosub alphabet
 *set letter6 letterzero
 *set myrandomname ((letter1 & letter2) & (letter3 & letter4)) & (letter5 & letter6)
 *goto myname

*if lengthlimit = 7
 *gosub alphabet
 *set letter1 letterzero
 *gosub alphabet
 *set letter2 letterzero
 *gosub alphabet
 *set letter3 letterzero
 *gosub alphabet
 *set letter4 letterzero
 *gosub alphabet
 *set letter5 letterzero
 *gosub alphabet
 *set letter6 letterzero
 *gosub alphabet
 *set letter7 letterzero
 *set myrandomname ((letter1 & letter2) & (letter3 & letter4)) & ((letter5 & letter6) & letter7)
 *goto myname

*if lengthlimit = 8
 *gosub alphabet
 *set letter1 letterzero
 *gosub alphabet
 *set letter2 letterzero
 *gosub alphabet
 *set letter3 letterzero
 *gosub alphabet
 *set letter4 letterzero
 *gosub alphabet
 *set letter5 letterzero
 *gosub alphabet
 *set letter6 letterzero
 *gosub alphabet
 *set letter7 letterzero
 *gosub alphabet
 *set letter8 letterzero
 *set myrandomname ((letter1 & letter2) & (letter3 & letter4)) & ((letter5 & letter6) & (letter7 & letter8))
 *goto myname

*if lengthlimit = 9
 *gosub alphabet
 *set letter1 letterzero
 *gosub alphabet
 *set letter2 letterzero
 *gosub alphabet
 *set letter3 letterzero
 *gosub alphabet
 *set letter4 letterzero
 *gosub alphabet
 *set letter5 letterzero
 *gosub alphabet
 *set letter6 letterzero
 *gosub alphabet
 *set letter7 letterzero
 *gosub alphabet
 *set letter8 letterzero
 *gosub alphabet
 *set letter9 letterzero
 *set myrandomname (((letter1 & letter2) & (letter3 & letter4)) & ((letter5 & letter6) & (letter7 & letter8))) & letter9
 *goto myname

*if lengthlimit = 10
 *gosub alphabet
 *set letter1 letterzero
 *gosub alphabet
 *set letter2 letterzero
 *gosub alphabet
 *set letter3 letterzero
 *gosub alphabet
 *set letter4 letterzero
 *gosub alphabet
 *set letter5 letterzero
 *gosub alphabet
 *set letter6 letterzero
 *gosub alphabet
 *set letter7 letterzero
 *gosub alphabet
 *set letter8 letterzero
 *gosub alphabet
 *set letter9 letterzero
 *gosub alphabet
 *set letter10 letterzero
 *set myrandomname (((letter1 & letter2) & (letter3 & letter4)) & ((letter5 & letter6) & (letter7 & letter8))) & (letter9 & letter10)
 *goto myname



*label myname

My random name is: [b]$!{myrandomname}[/b]

Would you like to keep this name or pick again?

*choice
 #Pick again
  *goto naming
 #Pick a name with a different length
  *goto randomnamegen
 #Keep this name
  *goto success


*label success

You have chosen to keep the name: [b]$!{myrandomname}[/b]

(This is where you link this code to the rest of your game.)

*finish



*label alphabet
*rand randomletter 1 26
*if randomletter = 1
 *set letterzero "a"
*if randomletter = 2
 *set letterzero "b"
*if randomletter = 3
 *set letterzero "c"
*if randomletter = 4
 *set letterzero "d"
*if randomletter = 5
 *set letterzero "e"
*if randomletter = 6
 *set letterzero "f"
*if randomletter = 7
 *set letterzero "g"
*if randomletter = 8
 *set letterzero "h"
*if randomletter = 9
 *set letterzero "i"
*if randomletter = 10
 *set letterzero "j"
*if randomletter = 11
 *set letterzero "k"
*if randomletter = 12
 *set letterzero "l"
*if randomletter = 13
 *set letterzero "m"
*if randomletter = 14
 *set letterzero "n"
*if randomletter = 15
 *set letterzero "o"
*if randomletter = 16
 *set letterzero "p"
*if randomletter = 17
 *set letterzero "q"
*if randomletter = 18
 *set letterzero "r"
*if randomletter = 19
 *set letterzero "s"
*if randomletter = 20
 *set letterzero "t"
*if randomletter = 21
 *set letterzero "u"
*if randomletter = 22
 *set letterzero "v"
*if randomletter = 23
 *set letterzero "w"
*if randomletter = 24
 *set letterzero "x"
*if randomletter = 25
 *set letterzero "y"
*if randomletter = 26
 *set letterzero "z"
*return


Naming a fake nation