Skip to content

Instantly share code, notes, and snippets.

@thomcc
Created March 13, 2012 14:44
Show Gist options
  • Save thomcc/2029202 to your computer and use it in GitHub Desktop.
Save thomcc/2029202 to your computer and use it in GitHub Desktop.
quine in ruby
x = [
%q{puts "x = ["},
%q{x.each_with_index {|s,i| puts "%q{" << s << "}" << (i == x.length-1 ? "" : ",") }},
%q{puts "]"},
%q{puts "x.map {|s| eval s}"}
]
x.map {|s| eval s}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment