Last active
August 29, 2015 14:21
Revisions
-
andersk revised this gist
May 27, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -7,7 +7,7 @@ import Control.Applicative -- not needed in GHC 7.10 t[a,b]=[3*a+b,2*b-a] _#[0,0]=0 0#_=3 n#p=[352,6497,2466,-1]!!((n-1)#t[(s+3)?7|s<-p])?(4^p!!0%7)%4 0&_=0 n&p=(n-1)&t p+maximum(abs<$>sum p:p) n!b=n&[1,-b] -
andersk revised this gist
May 27, 2015 . 1 changed file with 7 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -2,13 +2,15 @@ import Control.Applicative -- not needed in GHC 7.10 (?)=div (%)=mod t[a,b]=[3*a+b,2*b-a] _#[0,0]=0 0#_=3 n#p=3-3735978229407?(4^(7*(n-1)#t[(s+3)?7|s<-p]+p!!0%7))%4 0&_=0 n&p=(n-1)&t p+maximum(abs<$>sum p:p) n!b=n&[1,-b] f n=putStr$unlines[["__ \\/ "!!(2*n#t[a?2,-b]+a%2)|a<-[b-n!2+1..b+n!2+0^n?3]]|b<-[-n!0..n!0]] main=f 3 -
andersk revised this gist
May 27, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -9,6 +9,6 @@ n#p=3-mod(div 3735978229407$4^(7*(n-1)#t[div(s+3)7|s<-p]+mod(p!!0)7))4 0%_=0 n%p=(n-1)%t p+maximum(abs<$>sum p:p) n!b=n%[1,-b] f n=putStr$unlines[["__ \\/ "!!(2*n#t[div a 2,-b]+mod a 2)|a<-[b-n!2+1..b+n!2+0^div n 3]]|b<-[-n!0..n!0]] main=f 3 -
andersk revised this gist
May 27, 2015 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -3,12 +3,12 @@ import Control.Applicative -- not needed in GHC 7.10 t[a,b]=[3*a+b,2*b-a] _#[0,0]=0 0#_=3 n#p=3-mod(div 3735978229407$4^(7*(n-1)#t[div(s+3)7|s<-p]+mod(p!!0)7))4 0%_=0 n%p=(n-1)%t p+maximum(abs<$>sum p:p) n!b=n%[1,-b] f n=putStr$unlines[["__ \\/ "!!(2*n#t[div a 2,-b]+mod a 2)|a<-[b-n!2+1..b+n!2+fromEnum(n<3)]]|b<-[-n!0..n!0]] main=f 3 -
andersk revised this gist
May 27, 2015 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -5,9 +5,9 @@ import Control.Applicative -- not needed in GHC 7.10 t[a,b]=[3*a+b,2*b-a] _#[0,0]=3 0#_=0 n#p=mod(div 0xf5bf9ae65b4000$4^(7*(n-1)#t[div(s+3)7|s<-p]+mod(p!!0)7))4 0%_=0 n%p=(n-1)%t p+maximum(abs<$>sum p:p) n!b=n%[1,-b] f n=putStr$unlines[[" \\/ __"!!(2*n#t[div a 2,-b]+mod a 2)|a<-[b-n!2+1..b+n!2+fromEnum(n<3)]]|b<-[-n!0..n!0]] -
andersk revised this gist
May 27, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import Control.Applicative -- not needed in GHC 7.10 t[a,b]=[3*a+b,2*b-a] _#[0,0]=3 0#_=0 n#l=mod(div 0xf5bf9ae65b4000$4^(7*(n-1)#t[div(s+3)7|s<-l]+mod(l!!0)7))4 0%_=0 n%l=(n-1)%t l+maximum(abs<$>sum l:l) n!b=n%[1,-b] -
andersk revised this gist
May 27, 2015 . 1 changed file with 5 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -2,11 +2,13 @@ import Control.Applicative -- not needed in GHC 7.10 t[a,b]=[3*a+b,2*b-a] _#[0,0]=3 0#_=0 n#l=mod(div 0xf5bf9ae65b4000$4^(7*(n-1)#t[div(s+3)7|s<-l]+mod(head l)7))4 0%_=0 n%l=(n-1)%t l+maximum(abs<$>sum l:l) n!b=n%[1,-b] f n=putStr$unlines[[" \\/ __"!!(2*n#t[div a 2,-b]+mod a 2)|a<-[b-n!2+1..b+n!2+fromEnum(n<3)]]|b<-[-n!0..n!0]] main=f 3 -
andersk revised this gist
May 27, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -7,6 +7,6 @@ _#[0,0]=3 n#[a,b]=mod(div 0xf5bf9ae65b4000$4^(7*(n-1)#[div(s+3)7|s<-[3*a-b,a+2*b]]+mod(3*a-b)7))4 0%_=0 n%(c,d)=(n-1)%(2*c-d,c+3*d)+maximum(abs<$>[c,d,c+d]) f n=putStr$unlines[[" \\/ __"!!(2*n#[div a 2,b]+mod a 2)|a<-[b-n%(2,-1)+1..b+n%(2,-1)+fromEnum(n<3)]]|b<-[-n%(0,1)..n%(0,1)]] main=f 3 -
andersk created this gist
May 23, 2015 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ -- http://codegolf.stackexchange.com/questions/50521/ascii-art-of-the-day-2-flow-snakes import Control.Applicative -- not needed in GHC 7.10 _#[0,0]=3 0#_=0 n#[a,b]=mod(div 0xf5bf9ae65b4000$4^(7*(n-1)#[div(s+3)7|s<-[3*a-b,a+2*b]]+mod(3*a-b)7))4 0%_=0 n%(c,d)=(n-1)%(2*c-d,c+3*d)+maximum(abs<$>[c,d,c+d]) f n=putStr$unlines[[" \\/ __"!!(2*n#[div a 2,b]+mod a 2)|a<-[b-max(n%(2,-1)-1)0..b+n%(2,-1)+fromEnum(n<3)]]|b<-[-n%(0,1)..n%(0,1)]] main=f 3