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

**URL:** https://forum.makecode.com/t/how-do-i-define-a-function-in-a-block-code-tutorial-hint-without-showing-the-function/12136
**Category:** micro:bit
**Created:** [February 11, 2022, 5:24pm UTC](https://forum.makecode.com/t/how-do-i-define-a-function-in-a-block-code-tutorial-hint-without-showing-the-function/12136 "2022-02-11T17:24:38Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Yngel](https://avatars.discourse-cdn.com/v4/letter/y/b487fb/32.png) [@Yngel](https://forum.makecode.com/u/Yngel)
#### Post date: [February 11, 2022, 5:24pm UTC](https://forum.makecode.com/t/how-do-i-define-a-function-in-a-block-code-tutorial-hint-without-showing-the-function/12136/1 "2022-02-11T17:24:38Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![shakao](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/shakao/32/113_2.png) [@shakao](https://forum.makecode.com/u/shakao)
#### Post date: [February 11, 2022, 10:26pm UTC](https://forum.makecode.com/t/how-do-i-define-a-function-in-a-block-code-tutorial-hint-without-showing-the-function/12136/2 "2022-02-11T22:26:59Z")

</div>

Ahh, unfortunately this isn’t currently possible in our tutorial/blocks system ☹ Please feel free to file a [feature request](https://github.com/microsoft/pxt-arcade/issues/new/choose) on Github, this seems like a super useful thing for us to add!

---

<div class="post-metadata">

### Author: ![Yngel](https://avatars.discourse-cdn.com/v4/letter/y/b487fb/32.png) [@Yngel](https://forum.makecode.com/u/Yngel)
#### Post date: [February 14, 2022, 8:09pm UTC](https://forum.makecode.com/t/how-do-i-define-a-function-in-a-block-code-tutorial-hint-without-showing-the-function/12136/3 "2022-02-14T20:09:14Z")

</div>

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