Skip to content

Instantly share code, notes, and snippets.

@ma2gedev
Created June 15, 2013 12:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ma2gedev/5787961 to your computer and use it in GitHub Desktop.
Save ma2gedev/5787961 to your computer and use it in GitHub Desktop.
ramen quine
eval$s=%w'c=2;b="BAhsKzX/////////////////////A8D/////////////z8/zPwAA//8Pw88//z8
DwD/w/z//P///P/D/D/8///8Pw//D/wP//8PPw/AP8P//8P8P/P////////////////////8=";n=Mar
sh al.load(b.unpack("m")[0]);r="";n.to_s(2).reverse.unpack( "a64"*
12).each{|l|r<<l<<10};x="BAhsKxH//// /P/w// D/8P /w//P//P/w //P/// /8=";l
=Marshal.load(x.unpa ck ("m")[ 0]);t="" ;l.to_ s(2).r
everse.unpack( "a 16"*12). each{|l|t<<l<<10}; y="";c .times
{r.lines.zip(t .lines){|a|y<<a[0].cho mp+a[1]};r=y;y=" ";};c> 2?c=1:
c+=1;$s[2]=c.t o_s;w=r.lines.first. ch omp.length;n =r.gsub(10.chr,"")
.reverse.t o_i(2);e="eval$s=% w"<<39 <<($ s* 3);o="";j= -1;(w*
12). times{|i|o<<((n[i]== 1)?e[j+=1]:32);o <<((i%w==(w- 1))?10
:"");};o[-7,6]=""<<39<<".join";puts(o)#c=2;b="BAhsKzX/////////////////////A8D///
//////////z8/zPwAA//8Pw88//z8DwD/w/z//P///P/D/D/8///8Pw//D/wP//8PPw/AP8P//'.join
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment