Skip to content

Instantly share code, notes, and snippets.

@olivierrr
Created February 1, 2015 03:05
Show Gist options
  • Save olivierrr/7ef676c28d6c428ad0a7 to your computer and use it in GitHub Desktop.
Save olivierrr/7ef676c28d6c428ad0a7 to your computer and use it in GitHub Desktop.
#!/bin/bash
# compile brainf*ck to groot
# "+" "i am groot"
# "-" "I am Groot"
# "." "I AM GROOOT"
# ">" "I AM GROOT"
# "<" "I am groot"
# "," "I am grooot"
# "[" "I'm Groot"
# "]" "We are Groot"
sed "s/+/i am groot\n/g ; s/-/I am Groot\n/g ; s/\./I AM GROOOT\n/g ; s/>/I AM GROOT\n/g ; s/</I am groot\n/g ; s/,/I am grooot\n/g ; s/\[/I'm Groot\n/g ; s/\]/We are Groot\n/g" | grep -v '^$'
#!/bin/bash
# compile groot to brainf*ck
# "+" "i am groot"
# "-" "I am Groot"
# "." "I AM GROOOT"
# ">" "I AM GROOT"
# "<" "I am groot"
# "," "I am grooot"
# "[" "I'm Groot"
# "]" "We are Groot"
sed "s/i am groot/+/g ; s/I am Groot/-/g ; s/I AM GROOOT/\./g ; s/I AM GROOT/>/g ; s/I am groot/</g ; s/I am grooot/,/g ; s/I'm Groot/\[/g ; s/We are Groot/\]/g" | tr -d '\n'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment