Skip to content

Instantly share code, notes, and snippets.

@LucasMW
Last active August 6, 2016 20:50
Show Gist options
  • Save LucasMW/ab62115bfe3e73906f9ec11fe47ebd4f to your computer and use it in GitHub Desktop.
Save LucasMW/ab62115bfe3e73906f9ec11fe47ebd4f to your computer and use it in GitHub Desktop.
Program valid in Rust, Ruby, Python, C, C++, Brainfuck, and POSIX Shell
#/*[/**/include <stdio.h>
#define print(_) int main() { if (sizeof('a') > 1) { printf("Hello from C\n"); } else { printf("Hello from C++\n"); } }
#define X */[allow()] macro_rules! p { ($($t:tt)*) => (fn main() { println!("Hello from Rust") }) } p! {
""":"
false || "exec" "echo" "Hello from sh"
" """
print((0 and "Hello from Ruby\n" or "Hello from Python"))
#define Y }/*
#define A ]-[------->+<]>-.-[->+++++<]>++.+++++++..+++.[--->+<]>-----.++[->+++<]>.++++++++++++.---.--.[->+++++<]>-.[->+++<]>++.[--->+<]>----.+++[->+++<]>++.++++++++.+++++.--------.-[--->+<]>--.+[->+++<]>+.++++++++.+[++>---<]>-.*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment