What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

You can build and preview a simple Snake-style game in Microsoft MakeCode using its browser simulator; a BBC micro:bit is only needed to play it on the physical 5×5 LED display. MakeCode provides the coding environment and device workflow, but the controls and game rules below are choices for this example—not an official micro:bit Snake ruleset.

What you need to make a micro:bit Snake game

  • Microsoft MakeCode: the micro:bit coding editor supports block-based programming and a JavaScript view. The Micro:bit Educational Foundation introduces it as a way to create and transfer code in its MakeCode guide.
  • A browser: MakeCode includes a simulator, so you can start coding and test the game without owning a board. Microsoft describes the editor, simulator, compilation, and transfer process in its MakeCode overview.
  • A BBC micro:bit, optionally: use a physical board if you want to play on the LEDs. The Foundation’s getting-started guide explains creating code and transferring it to a device.

The micro:bit’s 5×5 LED display makes the game a tiny grid rather than a large scrolling board. Its buttons and the simulator’s virtual device give you ways to interact with and test a project; the Foundation’s MakeCode technical documentation describes the editor views, simulator, and compilation and download details.

Choose the rules before building

There is no single official micro:bit Snake ruleset established by the platform sources. Decide how your version handles input, movement, food, growth, collisions, scoring, and restart, then make those rules visible to the player.

Use a clear control scheme

For this example, assign the A and B buttons to turns: A turns left relative to the snake’s current direction, and B turns right. This lets the snake keep moving without asking the player to choose a direction from scratch on every turn. Another project could use different controls, but state them clearly and make the same controls work in the simulator and on the board.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

Define movement and collisions

Represent the snake as an ordered list of grid positions, with the first position as its head. On each movement update, calculate the next head position from the current direction, add it to the front of the list, and remove the tail position unless food was eaten. Treat leaving the 5×5 grid or moving into the snake’s body as game over if those are the rules you choose. Preventing an immediate reversal is also a useful design choice: it stops the head from turning directly into the segment behind it.

Place food and grow the snake

Show food on a grid cell that is not occupied by the snake. When the head reaches that cell, keep the tail rather than removing it, increasing the snake’s length by one; then choose another unoccupied food cell. If there is no free cell left, decide whether filling the board is a win or another end condition.

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

Make score and game over readable

A 5×5 display has little room for text, so choose a simple signal. For example, briefly show a score as a number between rounds, or use a distinct LED pattern to mark game over. State what the pattern means and how the player starts again, such as pressing both buttons together. These are tutorial design choices, not fixed micro:bit conventions.

Build and test the game in MakeCode

  1. Open the micro:bit MakeCode editor and create a project. The Foundation’s MakeCode guide explains the blocks and JavaScript views.
  2. Set up the game state: initialize the snake’s starting position, its direction, a food position, and a score. Use grid coordinates from 0 to 4 for each axis, matching the 5×5 LED display.
  3. Add button handlers for your chosen turns. If you want to disallow reversing, ignore a turn that would point the snake directly back into itself.
  4. Run a repeated movement update: calculate the next head cell, check for a boundary or body collision, detect food, update the snake and score, and then redraw the LEDs. Choose a movement interval slow enough to follow on the small display.
  5. Test in the simulator: check turning, food placement, growth, boundary collisions, self-collisions, and restarting. MakeCode’s simulator lets you preview and interact with a virtual device in the browser, as described in the MakeCode overview and the Foundation’s technical documentation.
  6. Switch to JavaScript view if useful to inspect or edit the text version of the program. MakeCode offers blocks and JavaScript rather than requiring one format, as explained in the Foundation’s MakeCode guide.

The exact block names or code depend on how you implement the game; the official platform material cited here does not supply a canonical Snake program. Keep the rules and state updates consistent whichever MakeCode view you use.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Play in the simulator or on a physical micro:bit

Option Hardware needed What to expect
MakeCode simulator None; use a browser and the MakeCode editor. Preview and interact with a virtual micro:bit while developing.
Physical BBC micro:bit A micro:bit and a way to transfer the program. Play on the board’s 5×5 LEDs. The transfer route can vary by computer, browser, and device generation.

For physical play, create the program in MakeCode and transfer it to the board. Microsoft’s overview describes compilation and transfer to the MICROBIT drive, while the Foundation’s getting-started instructions cover creating and transferring code. Follow the on-screen instructions for your setup rather than assuming every computer or device uses an identical path.

Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

Common design problems to check

  • The snake reverses into itself: reject a direction change that points directly opposite the current direction, if your rules prohibit reversals.
  • Food appears under the snake: select a new food position only from unoccupied cells.
  • Movement seems too fast: lengthen the interval between movement updates until turns and LED changes are easy to follow.
  • Game-over feedback is unclear: use a distinctive LED pattern or pause and show the score, and tell players how to restart.
  • Simulator behavior differs from the board: test the same inputs and rules on the physical device after transferring the program; the simulator is a preview, not the hardware itself.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.