Advertisement
Figgles

MAL FAL select

Sep 29th, 2013
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.62 KB | None | 0 0
  1. #Change this.
  2. USER_NAME = 'user_name'
  3. #If you don't want one of the (MAXIMUM 1 anime) in there, remove the # from the bottom 3 to stop mandatory inclusion.
  4. #If you do that though, you might end up with more than one of the Max 1 anime.
  5. Stlist = \
  6. '''
  7. Aoki Hagane no Arpeggio: Ars Nova
  8. BlazBlue: Alter Memory
  9. Coppelion
  10. Diamond no Ace
  11. Diabolik Lovers
  12. Freezing Vibration
  13. Galilei Donna
  14. Gingitsune
  15. Golden Time
  16. Gundam Build Fighters
  17. Hajime no Ippo: Rising
  18. Kakumeiki Valvrave 2nd Season
  19. Kyousou Giga (TV)
  20. Little Busters!: Refrain
  21. Log Horizon
  22. Machine-Doll wa Kizutsukanai
  23. Meganebu!
  24. Nagi no Asukara
  25. Non Non Biyori
  26. Ore no Nounai Sentakushi ga, Gakuen Love Comedy wo Zenryoku de Jama Shiteiru
  27. Outbreak Company
  28. Phi Brain: Kami no Puzzle 3rd Season
  29. Pupa
  30. Samurai Flamenco
  31. Sekai de Ichiban Tsuyoku Naritai!
  32. Strike the Blood
  33. Tokyo Ravens
  34. Walkure Romanze
  35. White Album 2
  36. Yowamushi Pedal
  37. Yozakura Quartet: Hana no Uta
  38. Yuusha ni Narenakatta Ore wa Shibushibu Shuushoku wo Ketsui Shimashita.
  39. #IS: Infinite Stratos 2
  40. #Kuroko no Basket 2
  41. #Magi: The Kingdom of Magic
  42. '''
  43. import random
  44. f = Stlist.split('\n')
  45. y = []
  46. final_collection = []
  47. #Shouldn't need this because of random numbers but just in case.
  48. unique_ness = set()
  49. one_only = set()
  50. for line in f:
  51.     if not line: continue
  52.     li = line.strip()
  53.     if li[0] == '#':
  54.         one_only.add(li[1:])
  55.         y.append(li[1:])
  56.     else:
  57.         y.append(li)
  58.    
  59. count = 0
  60. y_index = len(y) - 1
  61. chosen = False;
  62. #This will make us a list of 6 anime but we require 7. This is because we want to make sure
  63. #we get a bad boy one only person in there.
  64. while (count < 6):
  65.     ran_int = random.randint(0,y_index)
  66.     if y[ran_int] in one_only and chosen:
  67.         continue
  68.    
  69.     if y[ran_int] not in unique_ness:
  70.         if y[ran_int] in one_only:
  71.             chosen = True;
  72.         unique_ness.add(y[ran_int])
  73.         final_collection.append(y[ran_int])
  74.         count += 1
  75.  
  76. #Make sure we get at least one 'one only' bad boy in there.
  77. if not chosen and len(one_only) > 0:
  78.     temp = list(one_only)
  79.     ran_int = random.randint(0,len(temp)-1)
  80.     final_collection.append(temp[ran_int])
  81. else:
  82.     while (count < 7):
  83.         ran_int = random.randint(0,y_index)
  84.         if y[ran_int] in one_only:
  85.             continue
  86.            
  87.         if y[ran_int] not in unique_ness:
  88.             unique_ness.add(y[ran_int])
  89.             final_collection.append(y[ran_int])
  90.             count += 1    
  91.    
  92. #print(final_collection)
  93. output = 'Team: %s' % USER_NAME
  94. for i in final_collection:
  95.     output += '\n'
  96.     output += i
  97. output += '\n'
  98. print(output)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement