# This program will calculate experience need or gold needed to get desired amount for a game called bladesoflegends
# http://bladesoflegends.com/?r=1178

import time

def main2():
    x = input("Return to main [y]es or [n]o >> ")
    if x == "y":
        main()
    elif x == "n":
        print("k")

    else:
        main2()
def main():
    z = input('Gold [1] or Experience [2] >> ')
    if z == '1':
        gold()
    elif z == '2':
        experience()
    else:
        print('No.')
        time.sleep(1)
        main()

def experience():
    print('\nThis will calculate how much experience and kills you need to level up.')
    time.sleep(0.5)
    totalexp = input('Total exp >> ')
    currentexp = input('Experience you have now >> ')
    expperkill = input('Experience per kill >> ')


    neededexp = int(totalexp) - int(currentexp)
    neededkills = int(neededexp) / int(expperkill)
    a = neededkills * 5.5
    b = a / 60
    c = b / 60
    d = c / 24
    print('\nYou need ' + str(neededexp) + ' to level up.')
    print('You have to kill ' + str(round(neededkills,0)) + ' creatures to level up.')
    print('It will take you ' + str(round(c,1)) + ' (' + str(round(d,1)) + ' days) non-stop hours to level up.')
    time.sleep(1)


def gold():
    print('\nThis will calculate how much creatures you need to kill to get desired gold.')
    time.sleep(0.5)
    currentgold = int(input('\nCurrent gold >> '))
    desiredamount = int(input('Wanted gold >> '))
    goldperkill = int(input('Gold per kill >> '))
    neededgold = desiredamount - currentgold
    neededkills = neededgold / goldperkill
    a = neededkills * 5.5
    b = a / 60
    c = b / 60
    d = c / 24
    print('\nYou need ' + str(neededgold) + ' gold.')
    print('You need to kill ' + str(round(neededkills,0)) + ' creatures.')
    print('It will take you ' + str(round(c,1)) + ' (' + str(round(d,1)) + ' days) non-stop hours to wanted gold.')
    time.sleep(0.5)
    z = input('\nReturn to main [y]es or [n]o >> ')
    if z == 'y':
        main()
    else:
        print('k')


main()

