Yeah, so basically it works by running through itself a couple times until it has a new use.
For example,
cycles = 0
while cycles < 8:
cycles += 1
hero.build('farm', 'a')
hero.ability('shockwave')
function6969()
Yeah, so basically it works by running through itself a couple times until it has a new use.
For example,
cycles = 0
while cycles < 8:
cycles += 1
hero.build('farm', 'a')
hero.ability('shockwave')
function6969()
After this, you would just add more code for the later cycles, for example,
while cycles >=8 and cycles < 12:
hero.ability('summon', hero.mana)
Hey, @MarmiteOnToast is the python version of @moonwatcher348 's code ready yet? Sorry to bother you, I just wanted to check.
@Terrell_Williams this should work
allsquares = 'abcdefgh'
tower = {
'a': {'name': 'none', 'level': 0},
'b': {'name': 'none', 'level': 0},
'c': {'name': 'none', 'level': 0},
'd': {'name': 'none', 'level': 0},
'e': {'name': 'none', 'level': 0},
'f': {'name': 'none', 'level': 0},
'g': {'name': 'none', 'level': 0},
'h': {'name': 'none', 'level': 0}
}
def build(t, s):
if len(s) > 1:
letters = list(s)
for letter in letters:
build(t, letter)
return
hero.build(t, s)
tower[s]['name'] = t
tower[s]['level'] += 1
def towers(start, end):
if str(start).isdigit():
start = allsquares.index(start)
else:
start = start
if str(end).isdigit():
end = allsquares.index(end) + 2
else:
end = end
return [tower[allsquares[i]] for i in range(start, end)]
def squares(start, end):
if str(start).isdigit():
start = allsquares.index(start)
else:
start = start
if str(end).isdigit():
end = allsquares.index(end) + 2
else:
end = end
return allsquares[start:end]
def upgrade(*args):
if len(args) > 1:
args = args
else:
list(args[0])
for s in args:
build(tower[s]['name'], s)
If you receive any errors please tell me and Iāll try to fix the issue.
Hello, I appear to be having an issue with my code. I would greatly appreciate if someone could give me code. Thank you in advance.
Starter code
while True:
hero.build('cannon', 'A')
hero.build('cannon", 'B')
How can I expand upon this starter code in order to win the $1000 prize?
Make them cannons do more
Could you provide an example?
while True:
hero.build('cannon', 'A')
hero.build('cannon', 'B')
hero.build('cannon', 'C')
Why have I lost 3000 ELO after applying your alteration?
Implement it better into your code and it will work well for you
Iāve added the line,
hero.build("cannon", "D")
to my code. I have lost even more ELO. I am desperate for your assistance. Please help me Lord Protector Drewhammad-Bakr
Using hero.time in a while True loop you can stock mana using farms for the first few seconds. Once the enemy waves start coming in hard, you can sell some of your farms and have even more money to build your defenses.
While you are still building and upgrading your farms you can use āshockwaveā to defend yourself. Hereās some code that can help you get started, use what I told you. (this is only for the first few seconds, not the whole code, build more defenses and improve your code. Take it as an example):
def attackUPgrades():
#Start off with on ice tower.
if hero.time > 0 and hero.time < 40:
enemy = hero.findNearestEnemy()
if enemy and enemy.distanceTo(hero) < 15:
hero.ability("shockwave")
hero.build("ice", "d")
def farmup():
hero.build("farm", "a")
hero.build("farm", "b")
hero.build("farm", "c")
hero.build("farm", "e")
hero.build("farm", "f")
hero.build("farm", "g")
hero.build("farm", "h")
while True:
attackUPgrades()
farmup()
Let me know if you need any more help.
Trust me, itās not that easy, there are thousands of players hungry for action. You will have to work very hard to get to that point, I am 86th in the world and have spent weeks on my code to get to this point.
All I have to say is: work hard and achieve your goal, and you can make it happen!
People be goinā crazy with the usernames
Yāall watch out Iām cominā for that first place!
When I was battling this one guy one the enemies on their side jumped onto my side and took 30 health from me, is this a glitch?
Just in time for this: