Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # ”エシ”
- import random
- random.seed() # Take seed from sysclock
- # Teams are: SOVWAR, QUESOC, AMFOR, DESCA, LIFOUR
- class team:
- def __init__(self, _name):
- self.name = _name
- population = 0
- stockpile = 0
- name = "DEFAULT"
- def fireat(self, _team):
- if self.stockpile > 0:
- _team.population -= random.randint(50,100)
- print("""
- _ _
- | | (_)
- ___ ___| |__ _
- / _ \/ __| '_ \| |
- | __/\__ \ | | | |
- \___||___/_| |_|_|""")
- PLAYERS = {'SOVWAR': team('SOVWAR'),
- 'QUESOC': team('QUESOC'),
- 'AMFOR': team('AMFOR'),
- 'DESCA': team('DESCA'),
- 'LIFOUR': team('LIFOUR')};
- print (" I N I T ")
- for k in PLAYERS:
- print(PLAYERS[k].name, end="; ")
- PLAYERS[k].stockpile= random.randint(0,100)
- print("Missiles: %d /" %PLAYERS[k].stockpile, end = " ")
- PLAYERS[k].population = random.randint(100,500)
- print("Population: %d" %PLAYERS[k].population)
- for k in PLAYERS:
- turns = []
- turns.append(PLAYERS[k].name)
- j = 0
- while True:
- print("%s Turn >" % turns[j], end = " ")
- _input = input()
- _input.upper()
- if _input == "FIRE":
- print("at whom >", end = " ")
- _input = input()
- if _input in PLAYERS:
- PLAYERS[_input].population -= random.randint(1,25)
- PLAYERS[turns[j]].stockpile -= 1
- print("%s pop: %d. %s stockpile: %d" % (PLAYERS[_input].name, PLAYERS[_input].stockpile, PLAYERS[turns[j]].name, PLAYERS[turns[j]].stockpile))
- j = j+1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement