# How to program output pin with random number

**URL:** <https://forum.makecode.com/t/how-to-program-output-pin-with-random-number/32995>\
**Category:** micro:bit\
**Created:** [January 6, 2025, 6:04pm UTC](https://forum.makecode.com/t/how-to-program-output-pin-with-random-number/32995 "2025-01-06T18:04:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexander](https://avatars.discourse-cdn.com/v4/letter/a/bc8723/32.png) [@alexander](https://forum.makecode.com/u/alexander)\
**Post date:** [January 6, 2025, 6:04pm UTC](https://forum.makecode.com/t/how-to-program-output-pin-with-random-number/32995/1 "2025-01-06T18:04:38Z")

</div>

Hello everyone, i’m very new in working wih micro:bit. At least im 37 years old, but i think its never to late 🙂 I never learnt coding so i’m very glad to use this block structur to make microbit i want him to do so far. Searching function lead to topic with javascript, hard for me to put in my little progamm (see in picture)

**What am I Using?**  
I’m using microbit V2 with extension board

**What am i trying?**  
I’d like to switch 12 relays in random order.  
Every output pin should only switch one time so that there are 12 signals to 12 pins in random order. I was successfull to write numbers from 0-11 in random order to the display.  
But how i can change from number on display to output pin.  
Hope i have written down my problem, so thats understable and you can help 🙂

> **[catching game](https://makecode.microbit.org/S83396-47762-14103-11211)**
>
> Erstellt mit ❤️ in Microsoft MakeCode for micro:bit.
