Micro:bit dice project and the board game AutumnLANDIA

The Micro:bit circuit board has endless possibilities for fun projects and programs. In this one, we will make it perform the functions of a dice so that we can use it in various board games. The specific board game we will be using with this project is something I called “AutumnLANDIA” and I created it for 5th grade students in 2019. I have chosen this name for the game because when I was creating the whole project it was that beautiful Autumn time when everything was speckled with yellow, brown and red tones, falling leaves and pumpkins everywhere, at the beginning of the first term. And I also love Autumn very much. Let’s continue.

IMG_6675
In the hands of a student stands the microbit board, which is the dice of the game. On the table is also the template of my improvised board game that the students are happily playing after the coding part.

Open the Micro:bit programming environment – https://makecode.microbit.org/#editor. Now I will describe what needs to be done to write the program’s code. Try running it yourself and see if it works. 

  1. Create the “on shake” event; all of the code will be put inside of that event.
  2. Create a new variable called “random” (the type of the variable is “number” since you will be storing a number inside of it).
  3. Use the “set variable” block. Paste it. Now, take the “pick random number” block (it’s from the dark purple menu) and paste it inside of the “set variable” block. In this way, you will be setting the variable to a random number. Now, for the range of the random number, write 1 to 6. Obviously, a normal dice has the numbers from 1 to 6, so the random number should be in this particular range.
  4. Create 6 separate if-else conditional blocks. Each block checks if the random number that is assigned to the variable is any of the numbers between 1 and 6. For example, the first if-else block checks if the variable “random” = 1, second one checks if it equals 2 and so, until it reaches 6.
  5. In each if-else block ,add an animation for the LED matrix of the corresponding number. You can use the classic way to show a number on a dice – with the number of dots (see on the picture below).
unnamed

The coding part is finished. When you upload it to your microbit circuit board, you should gently shake the microbit to get a random number, represented by the dots on the LED matrix.

The program is ready 😊 

All you need now is a bunch of smart students, some microbits and computers, a board game playing field (like the AutumnLANDIA one that I created) and 40-50 minutes of lesson time 😊 First, the students get explanations on what a variable and a condition is, then what a dice looks like and how it is used. They get their microbits and start coding, then uploading the code. Testing if everything works right. When they are done, you give them the playing fields and they start playing 😊 using their own code and microbit for each move.

If you like this project, and if you want to do it yourself or with your students, then you can go to this link (TpT) and get the whole activity, including the AutumnLANDIA board game sheet, the complete code on both a screenshot and on a ready to use .hex file (just drag and drop in makecode and you immediately get the whole code) and a colorful and interesting presentation with everything you may need – a step-by-step process of doing the project and a bit of theoretical knowledge like what is a variable and what is a conditional statement.

This is what you get in my resource

I uploaded a video in my YouTube channel, of the finished project, done with my 2019 4th graders that had so much fun! You can watch the video here:

https://youtu.be/ejQg9fg9JCg

Also, if you like this project, or some other project or resource of mine, you can always join my e-mail list and get exclusive weekly content directly to your e-mail inbox, like advice, tips, ideas for cool projects, lessons, freebies and so much more. Click this link to sign up for my weekly e-mails.

Leave a comment