There’s a great interview with Charlie Brooker in Custom PC magazine about how they made the interactive Black Mirror episode Bandersnatch, his roots in Sinclair Spectrum gaming and – most interesting of all – the stuff they had to leave out.
In Tracy King‘s article, Charlie refers to an early Sinclair game:
There was a game called Cheese Nibbler. It would draw a grey block on the screen comprised of other blocks, and every time you pressed the key, one of the blocks disappeared. Then at the end it would tell you how long it took you to press to make them disappear. That was the game. Cheese Nibbler.
I thought I’d have a go at making a micro:bit version, never having seen the original. You have to tilt your micro:bit to nibble each cheesy pixel, and when you finish your time in milliseconds scrolls across the display. The aim is to be as quick as you can.
Making it was a fun pastime including solving a few challenges such as how do you know when every pixel is dark (i.e. all the cheese has been eaten). There are a few ways to do this, I opted to make a function (it’s a procedure or subroutine really, but MakeCode calls them functions whether they return a value or not) called ‘haveIwonYet?’ that scans the display constantly to see if all the pixels are dark. If they are, the Boolean variable gameOver becomes True, and the program drops out of the main game While… loop
You can (just about) play Cheese Nibbler in the online simulator, but it’s more fun on a real micro:bit!