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

Grim determination functions not executed


I wrote the code for the level, then saw that most of the blocks aren’t doing what I expected. Further investigation shows that calls to functions that are defined in my code are not being executed.

I can put says in the main loop and they display fine. But when I put them at the start of the predefined commandSomething function, it becomes clear it is never reached — even though it’s the first call of the main loop.

Adding a trivial wrapper around say to try another custom function showed the same no-op effect.

Am I the only one? Restarting firefox didn’t help and the levels before that worked fine, obviously (and still do). No errors are displayed either.


Well, lynx, how about you give us your code? Perhaps it is something you haven’t caught yet.


As we like to say, “help us help you” and as ChronistGilver suggests, there is no way we can help with problems with calling of functions unless you show us what you are doing… (code/language/etc)

If you don’t want to show us your code then create a small function calling example that doesn’t work:


(defn hello [world]
  (.say this (str "Hello " world)))
(hello "world.")

This actually does work, but serves none-the-less as a simple example of a function call…


I’ll take that as a yes then. This wasn’t about calling conventions, something did break the interpreter silently. Rewriting a few inconspicuous lines outside the problematic area avoids it and I have no will to delve into internals, so let’s leave it at that.


In the future it helps if you give more info, there are some known problems with certain things (and more so with certain languages) but if you tell us (next to) nothing we can’t tell if you have discovered a new problem, hit an old one, or just made a typo.


I am having the exact same problem with JavaScript. Here is my code, and none of the this.say statments are running, except the one in the loop:

this.lowestHealthPaladin = function() {
    var lowestHealth = 99999;
    var lowestFriend = null;
    var friends = this.findFriends();
    for(var f=0; f < friends.length; f++) {
        var friend = friends[f];
        if(friend.type != "paladin") { continue; }
        if( < lowestHealth && < friend.maxHealth) {
            lowestHealth =;
            lowestFriend = friend;
    return lowestFriend;

this.commandPaladin = function(paladin) {
    // Heal the paladin with the lowest health using lowestHealthPaladin()
    // You can use paladin.canCast("heal") and command(paladin, "cast", "heal", target)
    // Paladins can also shield: command(paladin, "shield")
    // And don't forget, they can attack, too!
    if (paladin.canCast("heal") && this.lowestHealthPaladin()) {
        this.command(paladin, "cast", "heal", this.lowestHealthPaladin());
    } else {
        this.command(paladin, "shield");

this.commandPeasant = function(friend) {
    var coins = this.findItems();
    var coin = friend.findNearest(coins);
    if (coin) {
        this.command(friend, "move", coin.pos.x, coin.pos.y);
    } else {
        this.say("no coin");

this.commandGriffin = function(friend) {
    var enemy = friend.findNearest(this.findEnemies());
    if (enemy) {
        this.command(friend, "attack", enemy);

this.commandFriends = function() {
    this.say("commanding friends");
    // Command your friends.
    var friends = this.findFriends();
    for(var i=0; i < friends.length; i++) {
        var friend = friends[i];
        if(friend.type === "peasant") {
        } else if(friend.type === "griffin-rider") {
        } else if(friend.type === "paladin") {
    this.say("done commanding");

loop {
    // Summon griffin riders!
    if ( >= this.costOf("griffin-rider")) {


Your code has a runtime error (an error that cannot detected statically, it will only appear when you run the code).

Run your code and see if there is a white-on-red X appearing under your hero feet. If so you have a runtime error.
Then scroll through the code and see if there is an white-on-red X to the right of a code line. That is the error location. Click on the X on the right to get the exact error message.

For example the


will fail if you do not have boss start 3 equipped.