Skip to content

Instantly share code, notes, and snippets.

@matt-morris
Created April 28, 2017 03:37
Show Gist options
  • Save matt-morris/75c84b09f4e1d0b970a7266c53b7ee2b to your computer and use it in GitHub Desktop.
Save matt-morris/75c84b09f4e1d0b970a7266c53b7ee2b to your computer and use it in GitHub Desktop.
An ASCII Art Quine in Ruby
;;;def+;'@doubleEmms';end;;;class Quine;class<<self;def save;;;;;;;;;;;#
;;;;File.write('output.rb', File.read(__FILE__));end;end;end;require'pp';;
;;;; ;;;;
;;;; ;;;;
;;;; ;;;;
;;;; ;;;;
;;;; ;;;;
;;;; class XMYNETWZDz ;;;;
;;;; ;def foo;puts self.name#\. ;#;#
;;;; ;end;class VWXXy; ;#;#
;;;; end;class VWXXXy ;;;;
;;;; end;;; VX=p; #;#;
;;;; end;#/ ####
;;;; def z ####
;;;; end# .++VXWYWX#VXYVwvz+. ####
;;;; class XXXXXXXv;end;;;#++.. #;#;
;;;; class MXYXXVv;def XXYv;end;end;;#=+. ;;;;
;;;; def c; ( ) end;x=[]; ;;;;
;;;; ;x<<->{ (; p(''); ;) };c();#. ;;;;
;;;; x<<->{ (; p();; ;) };p; ;#;#
;;;; x<<->{ ( ) };p ;#;#
;;;; class MYXXVz;def xXYWXwv;end;p ####
;;;; p;;;;;;;;end;;;;;;;##+' ;#;#
;;;; ;#;#
;;;; ;#;#
;;;; ;;;;
;;;; ;;;;
;;;; ;;;;
;;;;$q=Quine.new;;;END{print(File.read(__FILE__));$q.class.send(:save)};#;
;;;p "npd/tnnffmcvpe00;tquui".reverse.chars.map{|c|(c.ord-1).chr}.join;#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment