Advertisement
Chaquator

Swag face generator

Jun 13th, 2015
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.93 KB | None | 0 0
  1. '''
  2. Swag face generator
  3.  
  4. Procedure: Use random() and such to determine parts will appear
  5.  
  6. Steps:
  7.     1) Start with the eyebrows
  8.     2) Add a few noses
  9.     3) Add the mouth(s)
  10. '''
  11.  
  12. import random
  13.  
  14. def face():
  15.     Face = ""
  16.     #Start with the eyebrows and eyes
  17.     Brows = ["", "", "", "", ">"]
  18.     Eyes = [":", ";"]
  19.    
  20.     Face += str(Brows[random.randrange(len(Brows))] * (random.randint(1, 3))) + str(Eyes[random.randrange(len(Eyes))])
  21.  
  22.     #Add a few noses
  23.     Noses = ["^", "`", "'", ",", "~", "*"]
  24.    
  25.     Face += "".join([Noses[random.randrange(len(Noses))] for i in range(random.randrange(3))])
  26.  
  27.     #Add the mouth(s)
  28.     Mouths = ["0", "O", "K", "L", "I", ")", "(", "]", "[", "{", "|", "\\", "/", "c", "U", "C", "S", "$", "3", "Y"]
  29.    
  30.     Face += (Mouths[random.randrange(len(Mouths))] * random.randint(1, 3))
  31.    
  32.     return Face
  33.  
  34. file = open("D:\Faces.txt", "w")
  35. Str = "\n".join([face() for i in range(5000)])
  36. file.write(Str)
  37. file.close()
  38.  
  39. print("done")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement