Last active
August 6, 2016 20:50
-
-
Save LucasMW/ab62115bfe3e73906f9ec11fe47ebd4f to your computer and use it in GitHub Desktop.
Program valid in Rust, Ruby, Python, C, C++, Brainfuck, and POSIX Shell
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
#/*[/**/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
From https://www.reddit.com/r/rust/comments/4ume9f/source_file_that_is_both_valid_rust_and_valid_ruby/d5ta3lk