Last active
January 5, 2021 02:43
-
-
Save kou029w/851053e5ad6d8e05fb0c649668795722 to your computer and use it in GitHub Desktop.
a brainfuck compiler written in bash
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
#!/bin/bash | |
grep -o . "$@"|sed '/\./cprintf 0x%x $((m[p]))|xxd -r | |
/\[/cwhile((m[p]));do | |
/]/cdone | |
/</c((p--)) | |
/>/c((p++)) | |
s/[+-]/((m[p]&&))/ | |
/^.$/d' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To use
From your command line: