Beispiel #1
0
def simulacion(IA,Team, strategy):
	a=True
	ter = 0
	profit =[0,0]
	buff = 0

	while a:
		mov=decision(Team,IA)
		mov=mov-1
		os.system('clear')
		des = getStrategy(Team.tipo, strategy[Team.tipo], profit)	
		res=batalla(mov,IA,Team, des)
		profit[1] =profit[1] + float((res[3][0])-(res[3][1]))
		nesDecision(profit, strategy[Team.tipo])
		if res[3][0] == 0:
			buff = buff+1
		if strategy[Team.tipo].newone==1:
			desProfit(strategy[Team.tipo], profit, buff)
		else:
			profit[1]=0
		con=conclusion(res)
		if con == 0:
			a=True
		elif con == 1:
			a=False
			return 1
		else:
			a = False
			return 2
		IA = res[0]
		Team=res[1]
Beispiel #2
0
# Score are stored in the file below
file_name_perm = "top_score.txt"


print "Enter your credentials:"
user_name = raw_input("Name> ")

while True:
    # Random Value and Range for the particular level
    rand_val, range_val = level_select(file_name_perm, user_name)

    # saving remaining life
    life_remain = game_logic(rand_val, range_val, life)

    # Printing result or conclusion
    conclusion(life_remain, rand_val, user_name, file_name_perm)

    print "Type 'quit()' to exit."
    print "or Press Enter to continue..."

    desc = raw_input("> ")

    # Check for exit or continue
    # "" this means Enter key was pressed
    if desc == "":
        # flush the variables
        level = 0
        result = ""
    else:
        break