Play Home Contribute GitHub Join Us Discourse Staff Members GitHub Contribution Guides Team

Grim Determination : nothing happens and no bugreport



I’m new and this is my first post. Hope I don’t mess up…

My Code
# Your goal is to protect Reynaldo

# Find the paladin with the lowest health.
def lowestHealthPaladin():
    lowestHealth = 99999
    lowestFriend = None
    friends = self.findFriends()
    for friend in friends:
        if friend.type != "paladin":
        if < lowestHealth and < friend.maxHealth:
            lowestHealth =
            lowestFriend = friend
    return lowestFriend

def commandPaladin(paladin):
    # Heal the paladin with the lowest health using lowestHealthPaladin()
    # You can use paladin.canCast("heal") and command(paladin, "cast", "heal", target)
    if paladin.canCast("heal") and lowestHealthPaladin():
        self.command(paladin, "cast", "heal", lowestHealthPaladin())
    # Paladins can also shield: command(paladin, "shield")
        self.command(paladin, "shield")

def commandPeasant(peasant, value):
    # collect coins of certain values
    coins = self.findItems()
    gems = []
    for c in coins:
        if c.value > value:
    gem = self.findNearest(gems)
    if gem:
        self.command(peasant, "move", gem.pos)

def commandGriffin(griffin):
    # attack the enemy
    enemies = self.findEnemies()
    if enemies != []:
    if griffin:
        self.command(griffin, "attack", griffin.finedNearest(enemies))

def commandFriends():
    # Command your friends.
    friends = self.findFriends()
    for friendIndex, friend in enumerate(friends):
        if friend.type == "peasant":
            commandPeasant(friend, friendIndex)
        elif friend.type == "griffin-rider":
        elif friend.type == "paladin":
# ---


# global variables

# check
self.say(lowestHealthPaladin()) # problem: NOTHING HapPENS!
self.say(self.findByType("paladin")) # ? not even NULL
self.say("hi!") # to keep it simple... but no, nothing

# move Paladins forward
for friend in self.findByType("paladin"):
    newX= friend.pos.x + 10
    self.command(friend, "move", {"x":newX ,"y":friend.pos.y}) 

    if > 2:  # to make sure they can move forward in setup
        if >= self.costOf("griffin-rider"):

I’m especially baffled by the fact that my hero says nothing on a beginning statement…


Well, and nothing else of the code works. It might be that the code does not beat the level, but I haven’t been able to test even a simple version, just to see if I understand how Paladin-casting works…

I reloaded the game several times, so that’s not it, I guess. I’m working in Chrome.
I feel kinda stupid.

Any ideas?