Advertisement
Guest User

Untitled

a guest
Apr 21st, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.28 KB | None | 0 0
  1. firstnames = ['Anthony', 'Timothy', 'Bob', 'Sean', 'John', 'Ivan', 'Sergey', 'Peter', 'Anton', 'Nikolas', 'Armen']
  2. lastnames = ['Smith', 'Parker', 'Conrad', 'Washington', 'Kennedy']
  3.  
  4. coordinatorset = {'role': 'coordinator', 'capacity': 1000000, 'fuelhrusage': 1, 'hardware': 0, 'hardwareusage': 0, 'hrdistance': 20, 'weapons': 'Yes', 'ammunition': 1000, 'ammunitionhrusage': 100}
  5. infectorset = {'role': 'infector', 'capacity': 500000, 'fuelhrusage': 2, 'hardware': 1000, 'hardwareusage': 10, 'hrdistance': 15, 'weapons': 'No', 'ammunition': 0, 'ammunitionhrusage': 0}
  6. soldierset = {'role': 'soldier', 'capacity': 500000, 'fuelhrusage': 2, 'hardware': 0, 'hardwareusage': 0, 'hrdistance': 20, 'weapons': 'Yes', 'ammunition': 2000, 'ammunitionhrusage': 200}
  7. technicianset = {'role': 'technician', 'capacity': 500000, 'fuelhrusage': 3, 'hardware': 1000, 'hardwareusage': 20, 'hrdistance': 15, 'weapons': 'Yes', 'ammunition': 1000, 'ammunitionhrusage': 100}
  8. scoutset = {'role': 'scout', 'capacity': 1000000, 'fuelhrusage': 2, 'hardware': 0, 'hardwareusage': 0, 'hrdistance': 30, 'weapons': 'Yes', 'ammunition': 1000, 'ammunitionhrusage': 100}
  9. workerset = {'role': 'worker', 'capacity': 500000, 'fuelhrusage': 3, 'hardware': 1500, 'hardwareusage': 40, 'hrdistance': 10, 'weapons': 'No', 'ammunition': 0, 'ammunitionhrusage': 0}
  10.  
  11. fsets = [coordinatorset, infectorset, soldierset, technicianset, scoutset, workerset]
  12.  
  13. i = 0
  14. b = 0
  15.  
  16. for item in lastnames:
  17.     c = 0
  18.     for item in firstnames:
  19.         tempdict = {'alias': firstnames[i] + lastnames[b], 'firstname': firstnames[i], 'familyname': lastnames[b]}
  20.         if tempdict['firstname'] == 'Anthony':
  21.             tempdict.update(coordinatorset)
  22.         elif tempdict['firstname'] != 'Anthony' and c < len(fsets)-1:
  23.             tempdict.update(fsets[c])
  24.         elif tempdict['firstname'] != 'Anthony' and c == len(fsets)-1:
  25.             tempdict.update(fsets[c])
  26.             c = 0
  27.  
  28.         file = open(lastnames[b] + ".txt", 'a')
  29.         file.write(str(tempdict) + '\n')
  30.         file.close()
  31.        
  32.         tempdict = {}
  33.         i = i + 1
  34.         c = c + 1
  35.  
  36.  
  37.     if i >= len(firstnames):
  38.         file = open("Families.txt", 'a')
  39.         file.write(lastnames[b] + '\n')
  40.         file.close()
  41.         b = b + 1
  42.         i = 0
  43.  
  44. print ('All is OK!')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement