Skip to content

Commit

Permalink
* setup Travis CI.
Browse files Browse the repository at this point in the history
  • Loading branch information
mame committed Nov 28, 2014
1 parent 191d5e2 commit 2a9525e
Show file tree
Hide file tree
Showing 5 changed files with 108 additions and 56 deletions.
19 changes: 19 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
language: ruby
rvm:
- 2.1.0
env: PATH=/usr/games:$PATH
before_install:
- sudo apt-get install -qq scala gauche scilab bash slsh gnu-smalltalk spl-core mlton
tcl valac iverilog mono-vbnc xsltproc yorick zoem aplus-fsf gnat afnix algol68g
gawk boo bf gcc g++ mono-mcs clojure open-cobol coffeescript clisp gforth f2c gfortran
golang groovy ghc icont iconx intercal jasmin-sable openjdk-6-jdk llvm ucblogo lua5.2
make maxima mono-devel nasm neko nickle nodejs gobjc ocaml octave pari-gp parrot
fp-compiler perl php5-cli pike7.8 ghostscript bsdgames swi-prolog python r-base
ratfor regina-rexx
before_script:
- cd vendor/
- make
- cd ../
script:
- make
110 changes: 55 additions & 55 deletions QR.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,60 +3,60 @@
s]};return~0;}"};V=->s,a,z{s.K(/(#{B*4})+/){a+"#{$&.size/2}"+z}};C="Console.Write";$D="program~QR";%(object~QR~extends~App{#{
f(%((display~"#{e[%(#{f(%[echo~-En~"#{Q[e[e["Transcript~show:~'#{d[%(H#{Q[E[%(fun~p~n=Z(Int.toSJ~n`x5e"~");p~0;p~0;p~130;List
.tabulate(127,p);SJ.map(fn~c=>(p(3+ord~c);Z"-1~0~";c))#{E[%(proc~f~{n}~{sJ~repeat~"Y"~$n};puts~a::=`x7e[reK~-all~{.}~"#{V[Q[e
[%(!t~mX{Z#{d[E[%(module~QR;!itial~beg!~$H("#{o="";f(%(Module~QR:Sub~MX:Dim~s,n,i,c~As~Object:n=Chr(10):For~Each~c~!"#{d["<?x
ml#{O="~version='1.0'"}?><?xml-#{I="stylesheet"} ~type=' text/xsl 'href='QR.xslt'?><xsl:#{I+O}~xmlns:xsl='http://www.w3.org
/1999/`x58SL/Transform'><xsl:output~met hod=' text '/>< #{U="xsl:template"}~match='/'><`x21[CDATA[#{%(H,format="#{
y="";f("^H{-}{txt}{#{Q[E[%(with~Ada.T ext _ Io;procedure~qr~is~beg!~Ada.Text_Io.Put_L!e("#{d[
%(Z"#{e[%W[STRINGz:=~226+~153 ,a:=z + ~166,b:=a+"2"+z+~160,c:=b+"8"+z+~165,t:="#{d[%(BEG
IN{s=#{E[%(f={n~as~!t|'Y'*n} ;a= 0;s=#{V[Q[E["#!clude"+M["#!clude<iostrea
m>`n!t~mX{std::cout<<#{E[%( c lass~Program{public~static~void~MX{System
.#{C+E[(%((doseq[s(lazy-ca t["IDENTIFICATION~DIVISION.""PROGR
AM-ID.~QR.""PROCEDURE~DIV ISION."'DISPLA`x59](map~#(str"~~~~^
""(.replace~%1"^"""^"^"" )"^"&")(re-seq~#".{1,45}""#{e[
%((f=(n)->Array(n+1).jo !~"Y");console.log("%s",#{V[E[%
((H-l!e"#{e[%(~:~A~." #{g*9}"~; ~:~B~A~."~WRITE(*,*)'"~A~;~
:~C~B~T`x59PE~."~'" ~CR~;~:~D~S"~#$D"~C~S^"~Z ~^"(&"~C~S^"~#{e[%(package~m
a!;import"fmt";fun c~mX{fmt.Pr!t#{E[%(Z'#{e[("ma!=put Str"+E[%(procedure~mX;i:=c:
=0;s:=#{E[%(.cla ss~public~QR`n.super~#{$T="java/io/Pr!tSt ream"}`n.method~public~st
atic~ma!([L#{S= "java/lang/"}SJ;)V~;]`n.limit~stack~2`ngetstat ic~#{S}System/out~L#$T;`
nldc~"#{e[%(cl ass~QR{public~static~void~ma!(SJ[]v){SJ~c[]=new~SJ [9000],y="",z=y,s="#{z=
t=(0..r=q=126 ).map{|n|[n,[]]};a="";b=->n{a<<(n%78+55)%84+42};(%(@s =global[#{i=(s=%(PR~"`
x48AI^~1.2~P R~"VISIBLE^~"#{Q["Z"+E[%(all:`n`t@echo~'#{d["l!el:99999; Z#{E[%(.assembly~t{}.
method~stat ic~void~MX{.entrypo! t~ldstr"#{e[%(m:db`x60#{e[s="$Z#{E[%(Z f#{E["require('util')
.Z#{E["#imp ort"+M["Z_sJ"+E[%(s= toascii#{E["Z#{E[%(say"#{e["#$D(output) ;beg!~H(#{f((p="eval
";%($_="#{ s=%(<?php~function~f ( $n){return~str_repeat("Y",$n);};$f="f"; $z=3+$w=strlen($s=#
{V[Q[E["!t ~mX{H#{E[%((________ ___ )dup~=/s(|~~~~~.~~~|)def(#{Q["qr:-H('# {Q[e[%(for~c~!"".jo
!(["say~'% s' ^n"%l~for~l~!#{E[d[% (eval $s=%q(#$s)),?']]}.split("^n")]):Z('cat ("r=fput(char(%d))
^n")'%ord( c))`nZ('cat("end^n") '))],?' ]}').",B]}){9~7{exch~dup~1~and~79~mul~ 32~add~exch~2~idiv
~3~1~roll~s ~exch~2~ !dex~exch~put~1~sub~dup~6 ~eq{1~sub}if}repea
t~s~=~pop~po p}f orall~=~qu it)]};r eturn~0;}"]], "{$f(", ")}"]})*3;echo"^x89PNG^r^n^ x1a^n";$m="";$t="^
xc0^0^xff";fo r($i=-1;$i<128*$ z;$m. =$c--?($w-$c||$ i>$z) &&$i/$z<($c<$w?ord($s[(!t)($ c/3)]):$c--%3+2)?$
t[2].$t[$c%3%2]. $t[$c%3]:"^0^0^0": "^0 ")$c=++$i%$z;fore ach (array("I`x48DR".pack("NNCV", $w+2,128,8,2),"IDA
T".gzcompress($m),"IEN D")as$d)echo~pa c k("NA*N",strlen($d) - 4,$d,crc32($d));?>);(s+N*(-s.s ize%6)).unpack("B*
")[0].K(/.{6}/){n=$&.t o_i~2;((n+14)/26 *6+n+47).chr}}";s|.|$ n=ord$&;substr~unpack(B8,chr$n- !t($n/32)*6-41),2|
eg;Z~pack"B*",$_).scan (/[~,-:A-z]+|(. ) /){p="s++#{$1?"chr~ # {$1.ord}+e":$&+?+};"+p}; p ),1){"'#$s',"}}'')
end."]}"`nend)]};quit" ]};t=num2cell (b= 11-ceil(s/13));fo r~n =1:9m={};for ~ i =1:141f=@(x,y,n)
repmat(["Ook"~x~"~Ook"~ y~32],[1~abs (n)]) ;m(i)=[f(z=46,6 3,n)~ f(q=z-(i < 1 3)*13,q,i-13)~f
(33,z,1)~f(63,z,n)];end ;t(x)=m(di ff([0~s (x=b==n)])+13 );end;Z f("%%s",t{:})) ] ] ]}"]})+N]};"+N
]}`x60`nglobal~_start`n_ start:mov ~edx,#{s.siz e } `nmov~ecx,m`n
mov~ebx,1`nmov~eax,4`n!t ~128`nmov~ebx,0`nmov~ eax,1`n !t~128)]}"call~void~[msco rlib]Sys t e m.Console::Wr
ite(sJ)ret})]};quit();",? $].K(?'){"'^''"}}')]. K(/[: "]/,":^0"),/[~Y`t;"(){}`[`]]/]}"~P R ~ "`x4bT`x48`x
58B`x59E~B`x59E)).size+1}x ~i8]c"#{s.K(/[^"]/){" ^%` x58"%$&.ord}}^00"declare~i32@puts(i8 * )def!e~i32@m
X{%1=call~i32@puts(i8*getel ementptr([#{i}x~i8]*@ s ,i32~0,i32~0))ret~i32~0})).bytes{|n| r ,z=z[n]||(b[
r/78];b[r];q<6083&&z[n]=[q+= 1,[]];t[n])};b[r/78] ;b[r]}";!t~i=0,n=0,q=0;for(;++n<126 ; )c[n]=""+(c
har)n;for(;i<s.length();){q=q *78+(s.charAt(i)-13) %84;if(i++%2>0){y=q<n?c[q]:y;c[n++] = z+y.charAt(
0);System.out.Z(z=c[q]);q=0;}} }})]}"`n!vokevirtual~#$T/Zln(L#{S}SJ;)V`nreturn`n.en d~metho d)+N]};H("D
O,1<-#"||*s);s?while~t:=ord(move (1))do{i+:=1;u:=-i;every~0to~7do{u:=u*2+t%2;t/:= 2};H("PLE ASE")^(i%4/
3);H("DO,1SUB#"||i||"<-#"||((c-u) %256));c:=u;};H("PLEASEREADOUT,1^nPLEASEGI VEUP");end)]).tr(B, ?&)]}'.tr('
&','YY');)]};})]}"~DUP~FOR~S"~&A,&" ~C~NE`x58T~S^"~&A)^",&"~C~0~DO~B~."~ &char("~COUNT~.~."~),& '"~CR~LOOP
~S^"~&^"^""~C~S"~end~#$D"~C~A~."~STOP" ~CR~A~."~END"~CR~B`x59E~;~D~ )]}"))],'#{f(',')}']}))] }"))["~~~~
^"~^".""STOP~RUN."])](Zln(str"#{g*8}"s)) )))]};}})]};} "]]],"$(f(","))"]};for~i~!~range(len(s)
):b~as~!t=s[i];a-=b;Z(('+'*-a~if~0>a~else'-' *a)+'.');a=b;).tr~B,?`x21]};K(/`x21/,"Y",s
);Z~s})]}";FORiTO`~UPBtDO`~INTn:=ABSt[i];Z(~(50+ n%64)+c+~(50+n%8MOD8)+c+~(50+nMOD8)+b+"`x4a"+a)
OD]*"REPR"]}")]}");end;)]+"`nsys.exit~0",/[^{}]/]}}",35 ){y<<",`n"+$S;"%s"}}")+y}]]></#{U}></xsl:#{I}>"].K~N,'
"&~VbLf~&"'}":s="~~~":For~i=0To~7:s~&=Chr(32-(Asc(c)>>7-i~And~1)*23):Next:#{C}(s~&n~&Chr(9)&n~&"~~"):Next:#{C}(n~&n~&n):End~S
ub:End~Module),7){o<<?,+$S+N;"%s"}}"#{o});end~endmodule)],?%]};return~0;}).reverse],/[`[`]$]/],"[f~",?]]}"~^x60.&]k^n::=^na)]
};Z"0~0~-1";)]]};),?']}';cr"]]]}"|sed~-E~-e~'s/([`x5eY]|Y.){1,120}/Zf("%s","^0");^n/g'],7){%(Zf("%s","#{d[d[$s],?']}")`n)}}qu
it)]}")),196){%(Z#$S;)}}})).gsub(/[!HJKXYZ^`~]/){[B*2,:write,B,:tring,:gsub,"ain()",B*4,:print,g,:in][$&.ord%47%12]})))*"")#_
[%(!t~mX{Z#{d[E[%(module~QR;!itial~beg!~#{f(%(Module~QR:Sub~MX:Dim~s,n,i,c~As~Object:n=Chr(10):For~Each~c~!"#{d["<?xml#{O="~v
ersion='1.0'"}?><?xml-#{I="stylesheet"}~type='te xt/xsl' href='QR .xslt'?><xsl:#{I+O}~xmlns:xsl='http://www.w3.org/1999/`x5
8SL/Transform'><xsl:output~method='text '/><# {U=" xsl: template"}~match='/'><`x21[CDATA[#{%(H,format="#{y="";f("^
H{-}{txt}{#{Q[E[%(with~Ada.Text_Io;pr oce d ure~qr~is~beg!~Ada.Text_Io.Put_L!e("#{d[%(Z"#{e[%
W[STRINGz:=~226+~153,a:=z+~16 6,b:= a +"2"+z+~160,c:=b+"8"+z+~165,t:="#{d[%(BEGIN{s=#{E[
%(f={n~as~!t|'Y'*n};a=0;s=#{ V[Q [E["#!clude"+M["#!clude<iostream>`n!t~mX
{std::cout<<#{E[%(class~Pro g ram{public~static~void~MX{System.#{C+E[(%
((doseq[s(lazy-cat["IDENTI FICATION~DIVISION.""PROGRAM-ID.~QR
.""PROCEDURE~DIVISION."'D ISPLA`x59](map~#(str"~~~~^""(.repla
ce~%1"^"""^"^"")"^"&")(r e-seq~#".{1,45}""#{e[%((f=(n)-
>Array(n+1).jo!~"Y");co nsole.log("%s",#{V[E[%((H-l!e"#
{e[%(~:~A~."#{g*9}"~; ~:~B~A~." ~WRITE(*,*)'"~A~;~:~C~B~T`x
59PE~."~'"~CR~;~:~D ~S"~#$D"~C~S^"~Z~^"(&"~C~ S^"~#{e[%(package~ma!;import
"fmt";func~mX{fmt. Pr!t#{E[%(Z'#{e[("ma!=putStr"+E[%( procedure~mX;i:=c:=0;s:=#{E
[%(.class~public ~QR`n.super~#{$T="java/io/Pr!tStream"}`n. method~public~static~ma!(
[L#{S="java/lan g/"}SJ;)V~;]`n.limit~stack~2`ngetstatic~#{S}Sy stem/out~L#$T;`nldc~"#{e
[%(class~QR{pu blic~static~void~ma!(SJ[]v){SJ~c[]=new~SJ[9000],y= "",z=y,s="#{z=t=(0..r=q
=126).map{|n| [n,[]]};a="";b=->n{a<<(n%78+55)%84+42};(%(@s=global[# {i=(s=%(PR~"`x48AI^~1.
2~PR~"VISIBL E^~"#{Q["Z"+E[%(all:`n`t@echo~'#{d["l!el:99999;Z#{E[%(.a ssembly~t{}.method~st
atic~void~M X{.entrypo!t~ldstr"# {e[%(m:db`x60#{e[s="$Z#{E[%(Zf#{E["req uire('util').Z#{E["#i
mport"+M["Z _sJ"+E[%(s=toascii#{ E["Z#{E[%(say"#{e["#$D(output);beg!~H(# {f((p="eval";%($_="#
{s=%(<?php ~function~f($n){retu r n~str_repeat("Y",$n);};$f="f";$z=3+$w=s trlen($s=#{V[Q[E["!
t~mX{H#{E[ %((___________)dup~= /s( |~~~~~.~~~|)def(#{Q["qr:-H('#{Q[e[%(fo r~c~!"".jo!(["say~'
%s'^n"%l~f or ~l~!#{E[d[%(eval$s=% q(#$s )),?']]}.split("^n")]):Z('cat("r=fput( char(%d))^n")'%ord
(c))`nZ('c at("end^n")'))],?']} ').",B] }){9~7{exch~dup~1~and~79~mul~32~add~ex ch~2~idiv~3~1~roll
~s~exch~2~! dex~exch ~put~1~sub~dup~6~eq{1~sub }if}repeat~s~=~pop
~pop}forall~ =~q uit)]};ret urn~0;} "]],"{$f(",") }"]})*3 ;echo"^x89PNG^r^n^x1a^n";$m ="";$t="^xc0^0^xff
";for($i=-1;$ i<128*$z;$m.=$c- -?($w -$c||$i>$z)&&$i /$z<( $c<$w?ord($s[(!t)($c/3)]):$c --%3+2)?$t[2].$t[$
c%3%2].$t[$c%3]: "^0^0^0":"^0")$c=+ +$i %$z;foreach(array ("I `x48DR".pack("NNCV",$w+2,128, 8,2),"IDAT".gzcomp
ress($m),"IEND")as$d)e cho~pack("NA*N" , strlen($d)-4,$d,crc 3 2($d));?>);(s+N*(-s.size%6)).u npack("B*")[0].K(/
.{6}/){n=$&.to_i~2;((n +14)/26*6+n+47). chr}}";s|.|$n=ord$&;s ubstr~unpack(B8,chr$n-!t($n/32) *6-41),2|eg;Z~pack
"B*",$_).scan(/[~,-:A- z]+|(.)/){p="s+ + #{$1?"chr~#{$1.ord} + e":$&+?+};"+p};p),1){"'# $ s',"}}'')end."]}"`
nend)]};quit"]};t=num2 cell(b=11-cei l(s /13));for~n=1:9m= {}; for~i=1:141f = @ (x,y,n)repmat(["
Ook"~x~"~Ook"~y~32],[1~ abs(n)]);m(i )=[f( z=46,63,n)~f(q= z-(i< 13)*13,q , i -13)~f(33,z,1)~
f(63,z,n)];end;t(x)=m(d iff([0~s(x =b==n)] )+13);end;Zf( "%%s",t {:}))]]]}"]})+ N ] };"+N]}`x60`ng
lobal~_start`n_start:mov ~edx,#{s. size}`nmov~e c x ,m`nmov~ebx,1
`nmov~eax,4`n!t~128`nmov ~ebx,0`nmov~eax,1`n!t ~128)]} "call~void~[mscorlib]Syst em.Conso l e ::Write(sJ)re
t})]};quit();",?$].K(?'){ "'^''"}}')].K(/[:"]/, ":^0" ),/[~Y`t;"(){}`[`]]/]}"~PR~"`x4bT` x 4 8`x58B`x59E~
B`x59E)).size+1}x~i8]c"#{s .K(/[^"]/){"^%`x58"%$ &.o rd}}^00"declare~i32@puts(i8*)def!e~i 3 2@mX{%1=call
~i32@puts(i8*getelementptr( [#{i}x~i8]*@s,i32~0,i 3 2~0))ret~i32~0})).bytes{|n|r,z=z[n]| | (b[r/78];b[r
];q<6083&&z[n]=[q+=1,[]];t[n ])};b[r/78];b[r]}";! t~i=0,n=0,q=0;for(;++n<126;)c[n]="" + (char)n;for
(;i<s.length();){q=q*78+(s.ch arAt(i)-13)%84;if(i+ +%2>0){y=q<n?c[q]:y;c[n++]=z+y.char A t(0);System
.out.Z(z=c[q]);q=0;}}}})]}"`n! vokevirtual~#$T/Zln(L#{S}SJ;)V`nreturn`n.end~method) +N]};H( "DO,1<-#"||
*s);s?while~t:=ord(move(1))do{i+ :=1;u:=-i;every~0to~7do{u:=u*2+t%2;t/:=2};H("PLE ASE")^(i% 4/3);H("DO,
1SUB#"||i||"<-#"||((c-u)%256));c: =u;};H("PLEASEREADOUT,1^nPLEASEGIVEUP");en d)]).tr(B,?&)]}'.tr ('&','YY');
)]};})]}"~DUP~FOR~S"~&A,&"~C~NE`x58 T~S^"~&A)^",&"~C~0~DO~B~."~&char("~C OUNT~.~."~),&'"~CR~LOO P~S^"~&^"^
""~C~S"~end~#$D"~C~A~."~STOP"~CR~A~."~ END"~CR~B`x59E~;~D~)]}"))],' #{f(',')}']}))]}"))["~~~ ~^"~^".""S
TOP~RUN."])](Zln(str"#{g*8}"s)))))]};}}) ]};}"]]],"$(f (","))"]};for~i~!~range(len(s)):b~as~!t
=s[i];a-=b;Z(('+'*-a~if~0>a~else'-'*a)+'.'); a=b;).tr~B,?`x21]};K(/`x21/,"Y",s);Z~s})]}
";FORiTO`~UPBtDO`~INTn:=ABSt[i];Z(~(50+n%64)+c+~ (50+n%8MOD8)+c+~(50+nMOD8)+b+"`x4a"+a)OD]*"REPR
"]}")]}");end;)]+"`nsys.exit~0",/[^{}]/]}}",35){y<<",`n "+$S;"%s"}}")+y}]]></#{U}></xsl:#{I}>"].K~N,'"&~VbLf~&
"'}":s="~~~":For~i=0To~7:s~&=Chr(32-(Asc(c)>>7-i~And~1)*23):Next:#{C}(s~&n~&Chr(9)&n~&"~~"):Next:#{C}(n~&n~&n):End~Sub:End~Mo
dule),3){%($H("%s",#$S);)+N}}end~endmodule)],?%]};return~0;}).reverse],/[`[`]$]/],"[f~",?]]}"~^x60.&]k^n::=^na)]};Z"0~0~-1";)
]]};),?']}';cr"]]]}"|sed~-E~-e~'s/([`x5eY]|Y.){1,120}/Zf("%s","^0");^n/g'],7){%(Zf("%s","#{d[d[$s],?']}")`n)}}quit)]}")),196)
{%(Z#$S;)}}})).gsub(/[!HJKXYZ^`~]/){[B*2,:write,B,:tring,:gsub,"ain()",B*4,:print,g,:in][$&.ord%47%12]})))*"")#_buffer_for_fu
#_buffer_for_future_bug_fixes_#_buffer_for_future_bug_fixes_#_buffer_for_future_bug_fixes_#_buffer_for_future_bug_fixes_#_buf
####################### Quine Relay -- Copyright (c) 2013, 2014 Yusuke Endoh (@mametter), @hirekoke ######################)
5 changes: 5 additions & 0 deletions src/Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ file "../Makefile" => ["Makefile.gen.rb", "code-gen.rb"] do |t|
ruby "Makefile.gen.rb"
end

file "../.travis.yml" => ["dot.travis.yml.gen.rb", "code-gen.rb"] do |t|
ruby "dot.travis.yml.gen.rb"
end

task :test do
ruby "test.rb"
end
Expand All @@ -35,4 +39,5 @@ task :default => %w(
../README.md
../langs.png
../Makefile
../.travis.yml
)
2 changes: 1 addition & 1 deletion src/code-gen.rb
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ class Verilog < CodeGen
File = "QR.v"
Cmd = "iverilog -o QR QR.v && ./QR -vcd-none > OUTFILE"
Apt = "iverilog"
Code = %q(%(module QR;initial begin $write("#{o="";f(PREV,7){o<<?,+$S+N;"%s"}}"#{o});end endmodule))
Code = %q(%(module QR;initial begin #{f(PREV,3){%($write("%s",#$S);)+N}}end endmodule))
end

class Vala < CodeGen
Expand Down
28 changes: 28 additions & 0 deletions src/dot.travis.yml.gen.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
require "yaml"
require_relative "code-gen"

apts = CodeGen::List.reverse.flat_map {|c| c.steps.map {|step| step.apt } }

utopic_to_precise = {
"clojure1.4" => "clojure",
}

apts = apts.flatten.map {|apt| utopic_to_precise[apt] || apt }.compact
apts.delete("ruby2.0")

yaml = {}
yaml["language"] = "ruby"
yaml["rvm"] = ["2.1.0"]
yaml["env"] = "PATH=/usr/games:$PATH"
yaml["before_install"] = [
"sudo apt-get install -qq #{ apts.join(" ") }",
]
yaml["before_script"] = [
"cd vendor/",
"make",
"cd ../",
]
yaml["script"] = ["make"]


File.write("../.travis.yml", YAML.dump(yaml))

0 comments on commit 2a9525e

Please sign in to comment.