比赛链接
2022.11.24 8000分代码,更新了地图,行动轨迹,每次循环只执行一个防御塔的建造和传送
map = [[], [0,[18,87],[18,74],[18,62],[18,52],[18,40],[18,28],[18,16]], [0,[30,87],[30,74],[30,62],[30,52],[30,40],[30,28],[30,16]], [0,[42,87],[42,74],[42,62],[42,52],[42,40],[42,28],[42,16]], ] ls = ['cannon','mage','archer','frost'] a = ['A','B','C','D','F','G','I'] b = [[77, 51],[77, 75],[78, 27],[102, 27],[101, 77],[90, 86],[90, 14]] ab = ["cannon","mage","mage","mage","mage","cannon","cannon","mage","mage"] t20 = [[30,51],[30,39],[30,64],[42,75],[42,51],[42,28],[30,26],[30,77],[18,75],[18,27],[30,88],[30,15]] b20 = ["archer","archer","archer","cannon","cannon","cannon","archer","archer","archer","archer","archer","archer"] ac1 = [(2,2,4),(2,2,5),(2,2,3),(0,3,2),(0,3,4),(0,3,6),(2,2,6),(2,2,2),(2,1,6),(2,1,2),(2,2,1),(2,2,7),(0,1,4) ,(1,1,3),(1,1,5),(1,1,1),(1,1,7),(2,3,1),(2,3,7)] i = 0 while i<len(t20): #先把公告区域建造 #print("第%d个建筑,法力值剩余:%d"%(i,hero.mana)) if hero.canBuildAt(t20[i][0], t20[i][1]): hero.build(b20[i], t20[i][0], t20[i][1]) i+=1 if hero.isReady("pull") and hero.isReady("teleport"): hero.special("pull", 60, 51) hero.wait(1.5) hero.special("teleport", 60, 51) hero.special("burst", 14, 51) i = 0 while i<len(a): #先把公告区域建造 #print("第",i,"建筑,法力值剩余:",hero.mana) hero.build(ab[i], a[i]) i+=1 if hero.isReady("pull") and hero.isReady("teleport"): hero.special("pull", 60, 51) hero.wait(1.5) hero.special("teleport", 60, 51) hero.special("burst", 14, 51) for i in range(len(b)): x = b[i][0] y = b[i][1] if hero.canBuildAt(x, y): hero.build("archer", x,y) i = 0 while hero.time<140: if hero.isReady("pull") and hero.isReady("teleport"): hero.special("pull", 60, 51) hero.wait(1.5) hero.special("teleport", 60, 51) hero.special("burst", 14, 51) x = ac1[i][1] y = ac1[i][2] name = ls[ac1[i][0]] hero.build(name,map[x][y][0],map[x][y][1]) i+=1 if i>=len(ac1): i = 0 print(hero.getWaveNumber()) while hero.time<140: if hero.isReady("pull") and hero.isReady("teleport"): hero.special("pull", 60, 51) hero.wait(1.5) hero.special("teleport", 60, 51) hero.special("burst", 14, 51) hero.build("mage", 30,51) hero.build("cannon", 30,39) hero.build("cannon", 30,64) hero.build("cannon", 30,27) hero.build("cannon", 'A') hero.build("cannon", 'F') hero.build("cannon", 'G') hero.build("cannon", 42,75) hero.build("cannon", 42,51) hero.build("cannon", 42,28) hero.build("mage", 'B') hero.build("mage", 'C') hero.special("push", 18, 51) print(hero.getWaveNumber()) while True: if hero.isReady("pull") and hero.isReady("teleport"): hero.special("pull", 60, 51) hero.wait(1.5) hero.special("teleport", 60, 51) hero.special("burst", 14, 51) hero.build("frost", 42,75) hero.build("frost", 42,51) hero.build("frost", 42,28) hero.build("frost", 'G') hero.build("frost", 'F') hero.build("frost", 'H') hero.build("frost", 'I') hero.build("frost", 29,52) hero.build("cannon", 30,39) hero.build("cannon", 30,64) hero.build("mage", 'A') hero.build("mage", 'B') hero.build("mage", 'C') hero.special("push", 18, 51)View Code
标签:塔防,30,42,ice,archer,iron,18,cannon,mage From: https://www.cnblogs.com/jyssh/p/16923125.html