BBC micro:bit – Tetris Game

For this challenge we are creating a game of Tetris to play on the BBC micro:bit.

The game will be based on the following four shapes:

The game will use the following inputs:

  • Button A: Move current brick to the left
  • Button B: Move current brick to the right
  • Button A and B simultaneously: Rotate current brick clockwise

Video Demo

The game will use the LED screen which consists of a 5×5 grid of 25 LEDs.
Each LED can be on (value: 9 for maximum brightness) or Off (value: 0)
The side/borders of the grid will note be displayed.

The Python code will use 2-dimension arrays (list of lists in Python) to store the main grid (7×5) and the current brick (2×2)


To test this code you will need to use the Python Editor from the micro:bit website.

Python Code

Note: When testing this code, you may want to remove some of the #annotations especially if your micro:bit returns a “memory full” error.

Tagged with: