Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
hqqaazz authored Oct 6, 2020
1 parent b2d643c commit 5aa7e14
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions ordering.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def ordering(wantedlist,inital_penalty = 0):
xp_list, max_step = enchant_layer(total_step, total_enchantment, inital_penalty)

if penalty > 6:
return "Error!Cannot enchant"
return "Error!Cannot enchant!penalty larger than 6"


while numlist:
Expand Down Expand Up @@ -59,6 +59,9 @@ def ordering(wantedlist,inital_penalty = 0):
numlist.remove(tobe_enchanted)


xp_max = max(xp_list)


#penalty of merged books
xp_penalty_book = 0
for element in ordering_num:
Expand All @@ -73,10 +76,7 @@ def ordering(wantedlist,inital_penalty = 0):
sortedlist.remove(k)
break

xp_max = 0
for i in xp_list:
if i > xp_max:
xp_max = i


print(ordering)
print("max:",xp_max)
Expand All @@ -85,13 +85,6 @@ def ordering(wantedlist,inital_penalty = 0):
return ordering



def list_to_step(wantedlist):
n = 1
wantedlist = [i[0] for i in wantedlist]



def enchant_layer(total_step,total_enchantment, inital_penalty):
xp_list = []
max_step = []
Expand Down

0 comments on commit 5aa7e14

Please sign in to comment.