I’ve been thinking of ways of sharing Python programs on Twitter and I’ve come up with something a bit crazy, but which might have other uses.
The micro:bit Python emojifier encodes and condenses Python programs using emojis. It also decodes them too, and turns strings of emojis back into full Python programs.
Many keywords are tokenised, in effect, into a single character. This means the programs take up less space, and so you could, for example, share longer programs in a tweet. I used carefully-chosen emojis so even the encoded programs can be read by humans. Our old friend the teleporting duck:
from microbit import * import radio radio.config(group=23) radio.on() while True: message = radio.receive() if message: display.show(Image.DUCK) if accelerometer.was_gesture('shake'): display.clear() radio.send('duck')
becomes:
π π²π» π»β(π₯=23) π»πβ© π γ°message = π».π₯ γ°βmessage: γ°γ°πΊπ(πΌπ¦) γ°βπ³.was_π€('π₯€'): γ°γ°πΊπΏ γ°γ°π».π€('duck')
I think this might have other uses.
It may also encourage reluctant students to engage with coding concepts by presenting them in a new, but familiar visual language. The emojis are, in effect, a visual abstraction of programming concepts.
Programs written pictorially could appeal to those who struggle with reading or find large blocks of text hard to process, in a way not even block coding can manage,
Maybe students could even write Python programs using emojis. It might make Python more accessible to those who only have mobile devices.
This is very much optimised for Python on the BBC micro:bit, but perhaps it could be applied to other languages.
What do you think? Let me know!