Commits

Anonymous committed 3565f90

asciibattler: a bit nicer code

Comments (0)

Files changed (1)

 def meancost(team):
     return int(sum((c.cost for c in team))/max(1, len(team)))
 
-counter = 10
-for i in range(100000):
-    battleround()
+def show(): 
     draw()
     erase()
     for i in range(Y+2):
         priorline()
+
+counter = 10
+for i in range(100000):
+    battleround()
+    show()
+    
     if len(team0) == 0 or len(team1) == 0:
         counter -= 1
     if counter <= 0: