Create.withcode.uk online python editor is now open source!

Create.withcode.uk online python editor is now open source!

Create.withcode.uk is an online python editor that allows you to write, run, debug and share python code in your web browser. It launched in April 2016 to help students learn to write code on any device without having to install any specialist software.

Create.withcode.uk
Create.withcode.uk

In June 2016 I added a BBC microbit simulator to make it easier for my students to write, debug and share python code for a BBC micro:bit. Since then, I’ve been approached by a number of different people to see if they can adapt or extend some of the features on this site. All of the resources on this site are published under the Creative Commons share-alike license which means you’re free to use anything here for whatever purpose as long as you reference me as the original author. Up until now though, whilst create.withcode.uk has been free to use, the source code that makes it work hasn’t been openly available. I’m really grateful to those of you who have got in touch to request a feature or report a bug but I’ve been really impressed with the response to the site from people who have ideas of how to make it even better.

I’m pleased to announce that create.withcode.uk is now open-source. This means that if you can think of a way to improve the python editor or you spot a bug that needs fixing, you don’t have to wait for me to code it: you can jump right in and adapt / extend / improve it however you like. You’re free to use it for your own projects – I’d love to hear from you if you find a use for it.

You can find the source code for create.withcode.uk here.

If I had the time, I’d love to extend or adapt create.withcode.uk for the following:

  • self marking python tests that integrate with moodle
  • create 3d games and objects using python
  • interactive competitive python quizzes that integrate with moodle

The possibilities are endless (but time is very limited!) so hopefully going open source will allow someone to get creative and innovative without me holding them back!

 

 

Doodle jump: microbit python game tutorial

Doodle jump: microbit python game tutorial

This tutorial will talk you through how to write, test, debug and improve the python code for a doodle jump style game on a BBC micro:bit.

Challenging
Warning: this isn’t easy

This microbit python game tutorial is possibly a little too advanced for beginners so have a look at some of the other tutorials if you’re just getting started or jump straight in here if you’re feeling confident.

Doodle jump is a brilliantly simple but infuriatingly addictive game where you have to control a green alien by moving it left and right to jump up to the next platform, as the world falls away beneath it. The original game won an Apple design award and it quickly took the gaming world by storm. You can play it here (it’s likely to be blocked if you’re viewing this tutorial page in school). The challenge of this tutorial is to attempt to scale down the game so it still works on a 5×5 LED screen on the BBC micro:bit whilst still being fun to play.

 

Try it with code
Try the code

Below is a sample of the doodle jump game that we’ll create using this tutorial.

Press Ctrl + Enter to run the code, or click on the run button that appears when you click on the {+} button in the bottom right corner of the code editor.

Press button A to move left and button B to move right.

If you want to test the game on an actual micro:bit, plug it into your computer, run the code and click on Download HEX and save that file onto your micro:bit.

microbit python tutorial: shake ‘n’ burn fire simulator

microbit python tutorial: shake ‘n’ burn fire simulator

This microbit python tutorial talks you through how to write python code that simulates fire on your micro:bit. It burns down gradually until you shake it to stoke the fire back to life.

It’s written for beginners so you don’t need any experience writing python code. It covers:

Concepts you'll understand
Concepts you’ll understand

Concepts:

  • Loops: repeating code with while and for loops
  • Selection: only running certain parts of the code if a condition is met
  • Images: how images can be represented as data in memory before being displayed on a screen
  • Operators: how the multiplication operator (*) works with strings, numbers and images

 

 

Skills covered in this tutorial
Skills covered in this tutorial

Skills:

  • How to change each pixel of an image on the micro:bit screen
  • How to use the accelerometer to check if the micro:bit has been shaken
  • How to choose a random number
  • How to fade and shift an image on the micro:bit screen

The next page shows a simulation of the code we’ll create in this tutorial.