Try now in the
Open Cloud »
(no sign-in required)

Make Up a Random Name

Create random pronounceable nicknames for yourself and your friends.

Run the code to make a random sequence of 6 letters. Try it several times; try lengths other than 6:

This gives the list of characters from a to z:

 In[1]:= XCharacterRange["a", "z"]
 Out[1]=

RandomChoice chooses a random character from the list. Each time you run the code, you get a different choice:

 In[2]:= XRandomChoice[CharacterRange["a", "z"]]
 Out[2]=

This gives a list of 6 random characters:

 In[3]:= XRandomChoice[CharacterRange["a", "z"], 6]
 Out[3]=

 In[1]:= XRandomChoice[CharacterRange["a", "z"], 6]
 Out[1]=

Get lists of vowels and consonants. Try adding y to the list of vowels:

Make a list of the vowels and give it the name vowels:

 In[1]:= Xvowels = {"a", "e", "i", "o", "u"}
 Out[1]=

Using the name vowels is the same as using the list:

 In[2]:= Xvowels
 Out[2]=

Complement gives all of the elements of the first list that are not in the second list. For example:

 In[3]:= XComplement[{1, 2, 3, 4, 5}, {2, 4}]
 Out[3]=

The consonants are the letters that are not vowels:

 In[4]:= Xconsonants = Complement[CharacterRange["a", "z"], vowels]
 Out[4]=

 In[1]:= Xvowels = {"a", "e", "i", "o", "u"}; consonants = Complement[CharacterRange["a", "z"], vowels]
 Out[1]=

Make random words out of 4 letters. Try other patterns of consonants and vowels:

Note: be sure you have already run the previous step.

This gives a random consonant:

 In[1]:= XRandomChoice[consonants]
 Out[1]=

This gives a random vowel:

 In[2]:= XRandomChoice[vowels]
 Out[2]=

String together consonants and vowels in a list to make random words:

 In[3]:= X{RandomChoice[consonants], RandomChoice[vowels], RandomChoice[consonants], RandomChoice[vowels]}
 Out[3]=

 In[1]:= X{RandomChoice[consonants], RandomChoice[vowels], RandomChoice[consonants], RandomChoice[vowels]}
 Out[1]=

Make a list of 4 alternations of consonants and vowels. Try numbers other than 4:

Table makes lists of things.

This makes a list of 4 random consonants:

 In[1]:= XTable[RandomChoice[consonants], {4}]
 Out[1]=

This makes a list of 4 consonant-vowel lists:

 In[2]:= XTable[{RandomChoice[consonants], RandomChoice[vowels]}, {4}]
 Out[2]=

Flatten flattens out the sublists:

 In[3]:= XFlatten[Table[{RandomChoice[consonants], RandomChoice[vowels]}, {4}]]
 Out[3]=

 In[1]:= XFlatten[Table[{RandomChoice[consonants], RandomChoice[vowels]}, {4}]]
 Out[1]=

Display the letters as a word in 40-point type. Try changing the size to something other than 40for example, 80:

StringJoin joins text strings in a list into a single text string:

 In[1]:= XStringJoin[{"wolf", "ram"}]
 Out[1]=

Use it to make a word out of a list of random letters:

 In[2]:= XStringJoin[ Flatten[Table[{RandomChoice[consonants], RandomChoice[vowels]}, {4}]]]
 Out[2]=

Change the size of text with Style. This writes wolfram in 40-point text (a point is a printers measure equal to 1/72 inch):

 In[3]:= XStyle["wolfram", 40]
 Out[3]=

Write a random word in 40-point text:

 In[4]:= XStyle[StringJoin[ Flatten[Table[{RandomChoice[consonants], RandomChoice[vowels]}, {4}]]], 40]
 Out[4]=

 In[1]:= XStyle[StringJoin[ Flatten[Table[{RandomChoice[consonants], RandomChoice[vowels]}, {4}]]], 40]
 Out[1]=

Make a column of 6 random names. Try numbers of names other than 6:

Column formats lists of things as columns:

 In[1]:= XColumn[{"one", "two", "three", "four"}]
 Out[1]=

Make a list of 6 random names:

 In[2]:= XTable[Style[ StringJoin[ Flatten[Table[{RandomChoice[consonants], RandomChoice[vowels]}, {4}]]], 40], {6}]
 Out[2]=

Use Column to format the names in a column:

 In[3]:= XColumn[Table[ Style[StringJoin[ Flatten[Table[{RandomChoice[consonants], RandomChoice[vowels]}, {4}]]], 40], {6}]]
 Out[3]=

 In[1]:= XColumn[Table[ Style[StringJoin[ Flatten[Table[{RandomChoice[consonants], RandomChoice[vowels]}, {4}]]], 40], {6}]]
 Out[1]=

Share ItMake a website that gives you a different random name each time you visit it:

Deploy the random name code to the Wolfram Cloud where anyone can use it:

 In[1]:= XCloudDeploy[ Delayed[ExportForm[ vowels = {"a", "e", "i", "o", "u"}; consonants = Complement[CharacterRange["a", "z"], vowels]; Style[StringJoin[ Flatten[Table[{RandomChoice[consonants], RandomChoice[vowels]}, {4}]]], 40], "PNG"]], "Permissions" -> "Public" ]
 Out[1]=

Click the link in the output to visit the site. Refresh the page in your browser to get a new random name.

Share the link by right-clicking it and choosing Copy Address. Paste the link into an email, tweet, or other message.

 In[1]:= XCloudDeploy[ Delayed[ExportForm[ vowels = {"a", "e", "i", "o", "u"}; consonants = Complement[CharacterRange["a", "z"], vowels]; Style[StringJoin[ Flatten[Table[{RandomChoice[consonants], RandomChoice[vowels]}, {4}]]], 40], "PNG"]], "Permissions" -> "Public" ]
 Out[1]=