Skip to content

Instantly share code, notes, and snippets.

@odditica
Created February 15, 2019 17:45
Show Gist options
  • Save odditica/470ccaed925579283f8482a27c8f6880 to your computer and use it in GitHub Desktop.
Save odditica/470ccaed925579283f8482a27c8f6880 to your computer and use it in GitHub Desktop.
gml2bf
// Brainfuck -> GML
// By @blokatt
// Conversion tool: https://jsfiddle.net/Blokatt/fxj1m7tn/
#macro MEMORY_SIZE 32768
#macro mem _m[_p]
#macro i mem = (mem + 1) & 0xff;
#macro d mem = (mem - 1) & 0xff;
#macro l _p --;
#macro r _p ++;
#macro p _out += chr(mem);
#macro X while (mem) {
#macro Y }
var _m = array_create(MEMORY_SIZE, 0);
var _p = 0;
var _out = "";
d X d d d d d d d r i l Y r d p d X d r i i i i i l Y
r i i p i i i i i i i p p i i i p X d d d r i l Y r d
d d d d p d d X d r i i i i l Y r d p d d d d d d d d
p i i i p d d d d d d p d d d d d d d d p d X d d d r
i l Y r d p i i i i i X d r i i i l Y r p i i i p X d
d r i i i i i l Y r i i i p d d d X d r i i i i l Y r
d p d d d d p d d p d d d d d d d d p X d d d r i l Y
r d d d p d d d d d d d d d d d d p i p i i i i i p d
d d d d d d p d d X d r i i i l Y r d p
show_message(_out);
game_end();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment