Created
December 29, 2015 22:37
-
-
Save fbidu/dc2e650bc7064908ffbf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from time import sleep | |
from os import system | |
from random import choice | |
def planify(dict): | |
"""Function that returns a list containing every item preceeded by | |
its key""" | |
result = [] | |
for key in dict.keys(): | |
for item in dict[key]: | |
result.append("%s %s" % (key, item)) | |
return result | |
objectives = { | |
'conquistar': ['24 territorios', '30 territorios', 'Africa e Asia', | |
'America do Norte e Africa', | |
'Europa, America do Sul e mais um a sua escolha', | |
'Europa, Oceania e mais um a sua escolha', | |
'America do Norte e Oceania', | |
'Asia e América do Sul'], | |
'derrotar': ['Os exércitos verdes', | |
'Os exércitos pretos', | |
'Os exércitos azuis'] | |
} | |
command = '\0' | |
game_objectives = planify(objectives) | |
while command != 'c': | |
name = str(input('Digite seu nome: ')) | |
player_objective = choice(game_objectives) | |
game_objectives.remove(player_objective) | |
print("Seu objetivo é: %s" % (player_objective)) | |
sleep(5) | |
system('clear') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment