Last active
August 1, 2017 23:12
-
-
Save UplinkCoder/002b31572073798897552af4e8de2024 to your computer and use it in GitHub Desktop.
brainfuck_helloworld as d-code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum hello_world = (() { | |
uint iPos, oPos; | |
ubyte[] output; | |
output.length = 16; | |
ubyte[32] cells; | |
uint cellPtr = 0; | |
cells[cellPtr] += 10 ; | |
while(cells[cellPtr]) { | |
cellPtr += 1 ; | |
cells[cellPtr] += 7 ; | |
cellPtr += 1 ; | |
cells[cellPtr] += 10 ; | |
cellPtr += 1 ; | |
cells[cellPtr] += 3 ; | |
cellPtr += 1 ; | |
cells[cellPtr] += 1 ; | |
cellPtr -= 4 ; | |
cells[cellPtr] -= 1 ; | |
} | |
cellPtr += 1 ; | |
cells[cellPtr] += 2 ; | |
output[oPos++] = cells[cellPtr]; | |
cellPtr += 1 ; | |
cells[cellPtr] += 1 ; | |
output[oPos++] = cells[cellPtr]; | |
cells[cellPtr] += 7 ; | |
output[oPos++] = cells[cellPtr]; | |
output[oPos++] = cells[cellPtr]; | |
cells[cellPtr] += 3 ; | |
output[oPos++] = cells[cellPtr]; | |
cellPtr += 1 ; | |
cells[cellPtr] += 2 ; | |
output[oPos++] = cells[cellPtr]; | |
cellPtr -= 2 ; | |
cells[cellPtr] += 15 ; | |
output[oPos++] = cells[cellPtr]; | |
cellPtr += 1 ; | |
output[oPos++] = cells[cellPtr]; | |
cells[cellPtr] += 3 ; | |
output[oPos++] = cells[cellPtr]; | |
cells[cellPtr] -= 6 ; | |
output[oPos++] = cells[cellPtr]; | |
cells[cellPtr] -= 8 ; | |
output[oPos++] = cells[cellPtr]; | |
cellPtr += 1 ; | |
cells[cellPtr] += 1 ; | |
output[oPos++] = cells[cellPtr]; | |
cellPtr += 1 ; | |
output[oPos++] = cells[cellPtr]; | |
return output[0 .. oPos];} | |
); | |
pragma(msg, cast(string) hello_world()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment