Random Number

MoonCampaign by Yashas (9 years)

At Moonpreneur, we empower students to turn ideas into reality through hands-on project & product building.
Our MoonCampaigns highlight their creativity, public speaking, presentation skills, and teamwork.

Quarterly MoonCampaigns: Four Innovation and Leadership Showcases Annually by
Every Student—Thousands of Inspiring Learning Stories Unveiled.

Likes

Rating

50 days left

Your support will go a long way in encouraging Yashas and taking their innovation Random Number to new heights.
Random Number
terms and conditions
:

Random Number

:

Yashas

:

Show and Tell

:

Show n Tell

:

Coming Soon

About the Innovator

Hello! My name is Yashas. I’m 9 years old, and I enjoy swimming and playing outside. For my show-and-tell project, I made a Random Number Generator using the micro:bit. When you shake the micro:bit, it uses a random command to choose a number between 1 and 6. I used the random.randint block to do this. The number shows up on the screen after a 1-second pause, which I added using the sleep(1000) command. You can also change the number range—like from 1 to 8—to get different results. It’s a fun way to practice coding and randomness!

Want your child to be part of an innovative and creative competition?

STORY

Total Views:

Hi everyone! My name is Yashas. I am 9 years old and in school, I enjoy learning new things—especially when it comes to coding. In my free time, I like swimming and playing outside. For my show-and-tell project, I created something simple but fun: a Random Number Generator using the micro:bit.


My project works like a digital dice! When you shake the micro:bit, it randomly picks a number. I used the random.randint block in the code to choose a number between 1 and 6. Once the number is chosen, it appears on the micro:bit screen.


To make the program smoother, I also added a pause using the sleep(1000) command, which makes the micro:bit wait 1 second before showing the result. If I change the number range in the code—for example, from 1 to 8—the micro:bit will pick from that new range too. I tested it and it worked perfectly!


This project helped me understand how randomness, inputs, and timing work in code. It was really cool to see how shaking a small device could create a new number each time. I had fun making this and I hope you enjoyed learning about it!

Every child is gifted. Discover how yours can innovate and lead
Feedback

You Might Also Like

Every child is gifted. Discover how yours can innovate and lead