How do I define a function in a block code tutorial hint without showing the function?

I’m working on a block code tutorial in Norwegian for the “chase the dot” game on the Micro:Bit.
I’ve run into a slight problem.
In one of my hints, I’m calling for a function that isn’t defined in the hint itself, making the rendered block show as a gray JavaScript block.
I know that the function has to be defined in the hint code to counter this, but I have no idea how to do this without including and rendering the whole function block. It’s fairly straight forward to do this with variables, and I assume it can be done with functions as well?

This is the JavaScript for the blocks I’m trying to render:

let bytte: game.LedSprite = null

bytte = game.createSprite(2, 2)

let jeger = game.createSprite(0, 0)

bytte.set(LedSpriteProperty.Blink, 3)

jeger.set(LedSpriteProperty.Brightness, 5)

// @highlight

NyRunde()

game.startCountdown(10000)

NyRunde is the function that starts a new round (ny runde = new round).
I could include the whole function:

function NyRunde () {

bytte.set(LedSpriteProperty.X, randint(0, 4))

bytte.set(LedSpriteProperty.Y, randint(0, 4))

if (!(bytte.isTouchingEdge())) {

    NyRunde()

}

}

But that would include a lot more code than I’d like to show as a hint. Adding an empty function block looks even worse, in my opinion, since the followers of this tutorial will already have built the function before this step.

Does anyone know how to define a function in a tutorial hint without showing the function?

Ahh, unfortunately this isn’t currently possible in our tutorial/blocks system :frowning: Please feel free to file a feature request on Github, this seems like a super useful thing for us to add!

1 Like

Wow! Your response time is really impressive! :smiley:
And thanks! I’ve filed a feature request on GitHub. :slight_smile: