#MonthOfMaking Day 6

#MonthOfMaking Day 6

micromag

March 6, 2019

March is all about MAKING!!

I have decided to take on the challenge of making a 5-minute micro:bit make every day throughout March.

Day06 – Coin Flip

Today I have decided to make a Coin Flip program. Great for decision making! Let’s get coding!

Python Code

from microbit import *
import random
while True:
    if button_a.is_pressed():
        if random.choice([True, False]):
            display.show(Image.HAPPY)
        else:
            display.show(Image.SAD)

EduBlocks Code

EduBlocks code

MakeCode Code

MakeCode

Demo

Final Words

Come back Tomorrow for another fun 5-minute micro:bit make

Loading cart ⌛️ ...