From e3c2b1a4332c3620a8bc7361f271ffdf32ec9931 Mon Sep 17 00:00:00 2001 From: Abigail Date: Thu, 6 Jan 2022 21:36:22 +0100 Subject: Week 004: Fix references. For part 1, this means fiddling with the fodder lines. --- challenge-004/abigail/awk/ch-1.awk | 10 +++++----- challenge-004/abigail/awk/ch-2.gawk | 2 +- challenge-004/abigail/bash/ch-1.sh | 11 +++++------ challenge-004/abigail/bash/ch-2.sh | 2 +- challenge-004/abigail/c/ch-1.c | 7 +++---- challenge-004/abigail/c/ch-2.c | 2 +- challenge-004/abigail/lua/ch-1.lua | 9 ++++----- challenge-004/abigail/lua/ch-2.lua | 2 +- challenge-004/abigail/node/ch-1.js | 5 ++--- challenge-004/abigail/node/ch-2.js | 2 +- challenge-004/abigail/perl/ch-1.pl | 5 ++--- challenge-004/abigail/perl/ch-2.pl | 2 +- challenge-004/abigail/python/ch-1.py | 17 ++++++++--------- challenge-004/abigail/python/ch-2.py | 4 ++-- challenge-004/abigail/ruby/ch-1.rb | 4 ++-- challenge-004/abigail/ruby/ch-2.rb | 2 +- 16 files changed, 40 insertions(+), 46 deletions(-) (limited to 'challenge-004') diff --git a/challenge-004/abigail/awk/ch-1.awk b/challenge-004/abigail/awk/ch-1.awk index 2264ee94d1..ef3e23fbf5 100644 --- a/challenge-004/abigail/awk/ch-1.awk +++ b/challenge-004/abigail/awk/ch-1.awk @@ -1,7 +1,7 @@ #!/usr/bin/awk # -# See ../README.md +# See https://theweeklychallenge.org/blog/perl-weekly-challenge-004 # # @@ -67,8 +67,8 @@ BEGIN { } # -# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER -# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER? -# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER -# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER! +# FODDER FODDER FODDER FODDER FODDER FODDER FODDER +# FODDER FODDER FODDER FODDER FODDER FODDER FODDER? +# FODDER FODDER FODDER FODDER FODDER FODDER FODDER +# FODDER FODDER FODDER FODDER! # diff --git a/challenge-004/abigail/awk/ch-2.gawk b/challenge-004/abigail/awk/ch-2.gawk index 11c73f7913..d5954a9edf 100644 --- a/challenge-004/abigail/awk/ch-2.gawk +++ b/challenge-004/abigail/awk/ch-2.gawk @@ -1,7 +1,7 @@ #!/opt/local/bin/gawk # -# See ../README.md +# See https://theweeklychallenge.org/blog/perl-weekly-challenge-004 # # diff --git a/challenge-004/abigail/bash/ch-1.sh b/challenge-004/abigail/bash/ch-1.sh index 1740f2d690..090463de8e 100644 --- a/challenge-004/abigail/bash/ch-1.sh +++ b/challenge-004/abigail/bash/ch-1.sh @@ -1,7 +1,7 @@ #!/bin/sh # -# See ../README.md +# See https://theweeklychallenge.org/blog/perl-weekly-challenge-004 # # @@ -67,13 +67,12 @@ echo # # FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER -# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER -# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER +# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER, +# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER. # FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER? # FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER -# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER +# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER? # FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER: # FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER -# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER -# FODDER FODDER FODDER FODDER FODDER FODDER! +# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER! # diff --git a/challenge-004/abigail/bash/ch-2.sh b/challenge-004/abigail/bash/ch-2.sh index e9a2935272..38ea2179e2 100644 --- a/challenge-004/abigail/bash/ch-2.sh +++ b/challenge-004/abigail/bash/ch-2.sh @@ -1,7 +1,7 @@ #!/bin/sh # -# See ../README.md +# See https://theweeklychallenge.org/blog/perl-weekly-challenge-004 # # diff --git a/challenge-004/abigail/c/ch-1.c b/challenge-004/abigail/c/ch-1.c index 21131ffb53..a4bd327725 100644 --- a/challenge-004/abigail/c/ch-1.c +++ b/challenge-004/abigail/c/ch-1.c @@ -3,7 +3,7 @@ # include /* - * See ../README.md + * See https://theweeklychallenge.org/blog/perl-weekly-challenge-004 */ /* @@ -67,8 +67,7 @@ int main (void) { } /* - * FODDER FODDER FODDER FODDER FODDER FODDER FODDER - * FODDER FODDER FODDER FODDER FODDER FODDER FODDER. - * FODDER FODDER FODDER FODDER FODDER FODDER FODDER. + * FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER: * FODDER FODDER FODDER FODDER FODDER FODDER FODDER. + * FODDER FODDER FODDER FODDER FODDER FODDER FODDER!! */ diff --git a/challenge-004/abigail/c/ch-2.c b/challenge-004/abigail/c/ch-2.c index 3df60fc2dc..bbb7375b75 100644 --- a/challenge-004/abigail/c/ch-2.c +++ b/challenge-004/abigail/c/ch-2.c @@ -9,7 +9,7 @@ # define NR_OF_LETTERS 26 /* - * See ../README.md + * See https://theweeklychallenge.org/blog/perl-weekly-challenge-004 */ /* diff --git a/challenge-004/abigail/lua/ch-1.lua b/challenge-004/abigail/lua/ch-1.lua index 03a06fd74b..f8f39b4135 100644 --- a/challenge-004/abigail/lua/ch-1.lua +++ b/challenge-004/abigail/lua/ch-1.lua @@ -1,7 +1,7 @@ #!/opt/local/bin/lua -- --- See ../README.md +-- See https://theweeklychallenge.org/blog/perl-weekly-challenge-004 -- -- @@ -64,8 +64,7 @@ io . write ("\n") -- --- FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER --- FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER --- FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER --- FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER! +-- FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER +-- FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER +-- FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER!!!! -- diff --git a/challenge-004/abigail/lua/ch-2.lua b/challenge-004/abigail/lua/ch-2.lua index c1214ac67d..8454fa5d5d 100644 --- a/challenge-004/abigail/lua/ch-2.lua +++ b/challenge-004/abigail/lua/ch-2.lua @@ -1,7 +1,7 @@ #!/opt/local/bin/lua -- --- See ../README.md +-- See https://theweeklychallenge.org/blog/perl-weekly-challenge-004 -- -- diff --git a/challenge-004/abigail/node/ch-1.js b/challenge-004/abigail/node/ch-1.js index aba62f0098..aad1be89d3 100644 --- a/challenge-004/abigail/node/ch-1.js +++ b/challenge-004/abigail/node/ch-1.js @@ -1,7 +1,7 @@ #!/usr/local/bin/node // -// See ../README.md +// See https://theweeklychallenge.org/blog/perl-weekly-challenge-004 // // @@ -67,8 +67,7 @@ process . stdout . write ("\n") // -// FODDER FODDER FODDER FODDER FODDER FODDER FODDER -// FODDER FODDER FODDER FODDER FODDER FODDER FODDER +// FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER // FODDER FODDER FODDER FODDER FODDER FODDER FODDER // FODDER FODDER FODDER FODDER FODDER FODDER FODDER // FODDER FODDER FODDER FODDER FODDER FODDER FODDER diff --git a/challenge-004/abigail/node/ch-2.js b/challenge-004/abigail/node/ch-2.js index a239d89949..6327b42262 100644 --- a/challenge-004/abigail/node/ch-2.js +++ b/challenge-004/abigail/node/ch-2.js @@ -1,7 +1,7 @@ #!/usr/local/bin/node // -// See ../README.md +// See https://theweeklychallenge.org/blog/perl-weekly-challenge-004 // // diff --git a/challenge-004/abigail/perl/ch-1.pl b/challenge-004/abigail/perl/ch-1.pl index a36eb78e42..1921bd3903 100644 --- a/challenge-004/abigail/perl/ch-1.pl +++ b/challenge-004/abigail/perl/ch-1.pl @@ -10,7 +10,7 @@ use experimental 'signatures'; use experimental 'lexical_subs'; # -# See ../README.md +# See https://theweeklychallenge.org/blog/perl-weekly-challenge-004 # # @@ -54,8 +54,7 @@ while () { print "\n"; # -# FODDER FODDER FODDER FODDER FODDER FODDER FODDER -# FODDER FODDER FODDER FODDER FODDER FODDER FODDER +# FODDER FODDER FODDER FODDER FODDER FODDER FODDER!! # __DATA__ diff --git a/challenge-004/abigail/perl/ch-2.pl b/challenge-004/abigail/perl/ch-2.pl index 20cd5148b0..be5ee93be6 100644 --- a/challenge-004/abigail/perl/ch-2.pl +++ b/challenge-004/abigail/perl/ch-2.pl @@ -10,7 +10,7 @@ use experimental 'signatures'; use experimental 'lexical_subs'; # -# See ../README.md +# See https://theweeklychallenge.org/blog/perl-weekly-challenge-004 # # diff --git a/challenge-004/abigail/python/ch-1.py b/challenge-004/abigail/python/ch-1.py index 0f7f8bf725..af5d05111a 100644 --- a/challenge-004/abigail/python/ch-1.py +++ b/challenge-004/abigail/python/ch-1.py @@ -1,11 +1,11 @@ #!/opt/local/bin/python # -# See ../README.md +# See https://theweeklychallenge.org/blog/perl-weekly-challenge-004 # # -# Run as python ch-1.py +# Run as: python ch-1.py # import sys @@ -66,11 +66,10 @@ for i in range (0, len (pi), in_size): sys . stdout . write ("\n") # -# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER -# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER -# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER -# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER? -# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER -# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER -# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER! +# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER +# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER +# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER +# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER +# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER!! +# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER!! # diff --git a/challenge-004/abigail/python/ch-2.py b/challenge-004/abigail/python/ch-2.py index 4e94f7fe7d..26dd33b60f 100644 --- a/challenge-004/abigail/python/ch-2.py +++ b/challenge-004/abigail/python/ch-2.py @@ -1,11 +1,11 @@ #!/opt/local/bin/python # -# See ../README.md +# See https://theweeklychallenge.org/blog/perl-weekly-challenge-004 # # -# Run as python ch-2.py < input-file +# Run as: python ch-2.py < input-file # import fileinput diff --git a/challenge-004/abigail/ruby/ch-1.rb b/challenge-004/abigail/ruby/ch-1.rb index 7c9571686d..a5af29eeb0 100644 --- a/challenge-004/abigail/ruby/ch-1.rb +++ b/challenge-004/abigail/ruby/ch-1.rb @@ -1,7 +1,7 @@ #!/usr/bin/ruby # -# See ../README.md +# See https://theweeklychallenge.org/blog/perl-weekly-challenge-004 # # @@ -70,5 +70,5 @@ printf "\n" # FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER # FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER # FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER -# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER +# FODDER FODDER FODDER # diff --git a/challenge-004/abigail/ruby/ch-2.rb b/challenge-004/abigail/ruby/ch-2.rb index 5dfcb0afce..289187feed 100644 --- a/challenge-004/abigail/ruby/ch-2.rb +++ b/challenge-004/abigail/ruby/ch-2.rb @@ -1,7 +1,7 @@ #!/usr/bin/ruby # -# See ../README.md +# See https://theweeklychallenge.org/blog/perl-weekly-challenge-004 # # -- cgit From 44dbdf9f6469b72a383eb3b95fbaf17d228facca Mon Sep 17 00:00:00 2001 From: Abigail Date: Fri, 7 Jan 2022 14:07:10 +0100 Subject: Week 4, part1: Go solution --- challenge-004/abigail/README.md | 1 + challenge-004/abigail/go/ch-1.go | 73 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 challenge-004/abigail/go/ch-1.go (limited to 'challenge-004') diff --git a/challenge-004/abigail/README.md b/challenge-004/abigail/README.md index 75267e87b2..2847d51cf2 100644 --- a/challenge-004/abigail/README.md +++ b/challenge-004/abigail/README.md @@ -24,6 +24,7 @@ and printing. We may even need to filler comments to make it all work out. * [AWK](awk/ch-1.awk) * [Bash](bash/ch-1.sh) * [C](c/ch-1.c) +* [Go](go/ch-1.go) * [Lua](lua/ch-1.lua) * [Node.js](node/ch-1.node) * [Perl](perl/ch-1.pl) diff --git a/challenge-004/abigail/go/ch-1.go b/challenge-004/abigail/go/ch-1.go new file mode 100644 index 0000000000..961f901695 --- /dev/null +++ b/challenge-004/abigail/go/ch-1.go @@ -0,0 +1,73 @@ +package main + +// +// See https://theweeklychallenge.org/blog/perl-weekly-challenge-004 +// + +// +// Run as: go run ch-1.go < input-file +// + +import ( + "fmt" +) + +func main () { + first_ord := int ('"') + 1; + skip_ord := int ('\\'); + last_ord := int ('~'); + ord_range := last_ord - first_ord; + in_size := 5; + pi := [] rune ( + "%(uP7+Y`ME)gy(7')v?;%s^qc(Mj1}16idp'ONGs'2m.o,1HLY'}~P61@@Y-" + + "*O/.v,Jc~D+ttA'&EPjR(zXxD$dr,M$P=-f*YQqe,GIZ`0x5oL1(mpl17en`" + + ")Q$ge,L6_5.I;hj%yy6n,L_t')dtyy)[ugS&-3(c&lC:a&~8SP#+iis+WR&8" + + "*Y;V3/+JD@-J>7u0$Nh<#2&:@+#=`/*YtP-0t8uf+tf/V&yjx>+]S=&%d}7z" + + "0YXa9$SOyt$*mzv1&X(W(.{0G-Vya`0a}KI0pQD2,nV0:,WE0+#?F[>(iMb}" + + "%k(tB/UO0m.8R'x%Vys_-|IgL.y-n6(v[*#+/-J1#[`]" + + "&*M#'1wg" + + "-}+B}*jWDi)/2&k,h|/)+eu-3)9{mU-`:]M/YF$a.O0SF0{~2C.EjkZ&>|lD" + + "#%UmL+w)$V&14Ty0arq+%xnAo/XX/y0_=Bl/)f*}'Gc88'GV;X1RG~<+gJ8p" + + "&^E~A'/3N=*R2|j&SgD@-0St?*jL@'-ZsbD$+_hy.#HkF0cO_[#t0wL-8._r" + + "#0)@p#4(ha+lyD6,[|1w%_K//+c2#j.4xl2)SpX=.>)gp$R)ZP,IS%@,}%#J" + + "*1zj[,sIw#%6pwl%D'fk#Bx6'%4?.0&c9'?#R7P|&ZJ;M&q6q&&|h9?0LVI}" + + "(2lq>#/G+<,Bv`l+U'K?'2i}q+,J8W/7dU++X(l51R>#T&)fV0'I%FC%HHkt" + + "%{(NN&Kn$]*e0," + + "$K`U.%bSL*&dG^f,lN@.+jGbU.g8,s&FwUP$9p3S/)f(4,y>{*/L)t" + + "-Oi$Y*&I1x1Kyk#$}~i|)^4uG%|&sU)XNR-,PLl/.lmT'&_~it-16U9-B~A[" + + "(}s.a0~]Zj*<*~%-~N27%$O,*/a,,c%<#@60On3z0~3@B13UOG/A^&K,GRHi" + + ",S_:*&9I{_$nCM9&U^*9)WmPj+$TL8.]WpP)CWDR$u#7])K/Bi+,[B9(0~a&" + + "&=aag,L-UG#HoAx/=@p,&ux{:0($3X*[J<4,eh{E1F&tE$cGo.&C}15*:u{Z" + + ",:*H^'f,=~$,z%B)WZbL$DjA;/oFKa%.>ig/^o.90e/P=*Auex0TD}p/hncA" + + "/%d87#/u19,r&sM(A+4V0%4u$.}F+P0o|4e.g(<[#5yy*]3@5%II741/XZ>)Lm6e0``3L%.JF[+Z?8b(tj7C" + + "'S/z}#vS|i)S9[=*/nCG)PMaY-{pML);vN?%kRcr#*.Tg,x;42'(1w.0dA)S" + + ")-us%.#1$R-rkwf%m%B-(ctK8+4Sn^%*C1Y-wqsr%eNg11%$De&&07q+%1>-" + + "+mCl2%)V#w%#y:[,?t*D$64`9.U+{`-SBX-+gi/o)0B$q#V$tW+#lmM)';EH" + + "%yFPZ/Gy(~,dl@h)A&ju-Co2,-du++)[Awk&wE}p*H;._.[]4W+Eb7K#iiKB") + fmt . Print ("3.") + for i := 0; i < len (pi); i += in_size { + out := 0 + for j := i; j < i + in_size; j ++ { + out *= ord_range + out += int (pi [j]) - first_ord + if int (pi [j]) > skip_ord { + out -- + } + } + fmt . Printf ("%09d", out) + } + fmt . Print ("\n") +} + +// +// FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER +// FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER +// FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER? +// FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER +// FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER! +// -- cgit From 729d909478f75603982c1e15ea8cd60fc2bf20fa Mon Sep 17 00:00:00 2001 From: Abigail Date: Fri, 7 Jan 2022 14:36:10 +0100 Subject: Week 4, part1: Java solution --- challenge-004/abigail/README.md | 1 + challenge-004/abigail/java/ch-1.java | 66 ++++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 challenge-004/abigail/java/ch-1.java (limited to 'challenge-004') diff --git a/challenge-004/abigail/README.md b/challenge-004/abigail/README.md index 2847d51cf2..98e4afda0d 100644 --- a/challenge-004/abigail/README.md +++ b/challenge-004/abigail/README.md @@ -25,6 +25,7 @@ and printing. We may even need to filler comments to make it all work out. * [Bash](bash/ch-1.sh) * [C](c/ch-1.c) * [Go](go/ch-1.go) +* [Java](java/ch-1.java) * [Lua](lua/ch-1.lua) * [Node.js](node/ch-1.node) * [Perl](perl/ch-1.pl) diff --git a/challenge-004/abigail/java/ch-1.java b/challenge-004/abigail/java/ch-1.java new file mode 100644 index 0000000000..cba07272da --- /dev/null +++ b/challenge-004/abigail/java/ch-1.java @@ -0,0 +1,66 @@ +// +// See https://theweeklychallenge.org/blog/perl-weekly-challenge-004 +// + +// +// Run as: ln ch-1.java ch1.java; javac ch1.java; java ch1 < input-file +// + +import java.util.*; + +public class ch1 { + public static void main (String [] args) { + int first = '"' + 1; + int skip = '\\'; + int last = '~'; + int range = last - first; + int in_size = 5; + char [] pi = + ("%(uP7+Y`ME)gy(7')v?;%s^qc(Mj1}16idp'ONGs'2m.o,1HLY'}~P61@@Y-" + + "*O/.v,Jc~D+ttA'&EPjR(zXxD$dr,M$P=-f*YQqe,GIZ`0x5oL1(mpl17en`" + + ")Q$ge,L6_5.I;hj%yy6n,L_t')dtyy)[ugS&-3(c&lC:a&~8SP#+iis+WR&8" + + "*Y;V3/+JD@-J>7u0$Nh<#2&:@+#=`/*YtP-0t8uf+tf/V&yjx>+]S=&%d}7z" + + "0YXa9$SOyt$*mzv1&X(W(.{0G-Vya`0a}KI0pQD2,nV0:,WE0+#?F[>(iMb}" + + "%k(tB/UO0m.8R'x%Vys_-|IgL.y-n6(v[*#+/-J1#[`]" + + "&*M#'1wg" + + "-}+B}*jWDi)/2&k,h|/)+eu-3)9{mU-`:]M/YF$a.O0SF0{~2C.EjkZ&>|lD" + + "#%UmL+w)$V&14Ty0arq+%xnAo/XX/y0_=Bl/)f*}'Gc88'GV;X1RG~<+gJ8p" + + "&^E~A'/3N=*R2|j&SgD@-0St?*jL@'-ZsbD$+_hy.#HkF0cO_[#t0wL-8._r" + + "#0)@p#4(ha+lyD6,[|1w%_K//+c2#j.4xl2)SpX=.>)gp$R)ZP,IS%@,}%#J" + + "*1zj[,sIw#%6pwl%D'fk#Bx6'%4?.0&c9'?#R7P|&ZJ;M&q6q&&|h9?0LVI}" + + "(2lq>#/G+<,Bv`l+U'K?'2i}q+,J8W/7dU++X(l51R>#T&)fV0'I%FC%HHkt" + + "%{(NN&Kn$]*e0," + + "$K`U.%bSL*&dG^f,lN@.+jGbU.g8,s&FwUP$9p3S/)f(4,y>{*/L)t" + + "-Oi$Y*&I1x1Kyk#$}~i|)^4uG%|&sU)XNR-,PLl/.lmT'&_~it-16U9-B~A[" + + "(}s.a0~]Zj*<*~%-~N27%$O,*/a,,c%<#@60On3z0~3@B13UOG/A^&K,GRHi" + + ",S_:*&9I{_$nCM9&U^*9)WmPj+$TL8.]WpP)CWDR$u#7])K/Bi+,[B9(0~a&" + + "&=aag,L-UG#HoAx/=@p,&ux{:0($3X*[J<4,eh{E1F&tE$cGo.&C}15*:u{Z" + + ",:*H^'f,=~$,z%B)WZbL$DjA;/oFKa%.>ig/^o.90e/P=*Auex0TD}p/hncA" + + "/%d87#/u19,r&sM(A+4V0%4u$.}F+P0o|4e.g(<[#5yy*]3@5%II741/XZ>)Lm6e0``3L%.JF[+Z?8b(tj7C" + + "'S/z}#vS|i)S9[=*/nCG)PMaY-{pML);vN?%kRcr#*.Tg,x;42'(1w.0dA)S" + + ")-us%.#1$R-rkwf%m%B-(ctK8+4Sn^%*C1Y-wqsr%eNg11%$De&&07q+%1>-" + + "+mCl2%)V#w%#y:[,?t*D$64`9.U+{`-SBX-+gi/o)0B$q#V$tW+#lmM)';EH" + + "%yFPZ/Gy(~,dl@h)A&ju-Co2,-du++)[Awk&wE}p*H;._.[]4W+Eb7K#iiKB") . + toCharArray (); + System . out . print ("3."); + for (int i = 0; i < pi . length; i += in_size) { + int out = 0; + for (int j = i; j < i + in_size; j ++) { + out *= range; + out += pi [j] - first; + if (pi [j] > skip) { + out --; + } + } + System . out . printf ("%09d", out); + } + System . out . print ("\n"); + } +} + +// FODDER FODDER! -- cgit From 29230d1c0af2972b3cc1008566d160f1a22c3430 Mon Sep 17 00:00:00 2001 From: Abigail Date: Fri, 7 Jan 2022 15:36:13 +0100 Subject: Week 4, part 1: bc solution --- challenge-004/abigail/bc/ch-1.bc | 59 ++++++++++++++++++++++++++++++++++ challenge-004/abigail/t/ctest.ini | 12 +++++++ challenge-004/abigail/t/input-1-2 | 0 challenge-004/abigail/t/output-1-2.exp | 1 + 4 files changed, 72 insertions(+) create mode 100644 challenge-004/abigail/bc/ch-1.bc create mode 100644 challenge-004/abigail/t/input-1-2 create mode 100644 challenge-004/abigail/t/output-1-2.exp (limited to 'challenge-004') diff --git a/challenge-004/abigail/bc/ch-1.bc b/challenge-004/abigail/bc/ch-1.bc new file mode 100644 index 0000000000..98f682f3ab --- /dev/null +++ b/challenge-004/abigail/bc/ch-1.bc @@ -0,0 +1,59 @@ +#!/usr/bin/bc + +# +# See https://theweeklychallenge.org/blog/perl-weekly-challenge-004 +# + +# +# Run as: bc -l ch-1.bc +# + +scale = 3240 +4 * a (1) +halt + +# +# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER +# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER +# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER +# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER +# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER +# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER +# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER +# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER +# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER +# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER +# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER +# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER +# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER +# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER +# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER +# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER +# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER +# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER +# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER +# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER +# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER +# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER? +# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER +# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER +# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER +# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER +# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER +# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER +# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER +# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER +# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER +# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER +# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER +# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER +# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER +# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER +# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER +# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER +# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER +# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER +# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER +# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER: +# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER! +# diff --git a/challenge-004/abigail/t/ctest.ini b/challenge-004/abigail/t/ctest.ini index 161f1c35f0..c72f82b193 100644 --- a/challenge-004/abigail/t/ctest.ini +++ b/challenge-004/abigail/t/ctest.ini @@ -1,11 +1,23 @@ [names] 1-1 = Pi, 3242 digits +1-2 = Pi, 3242 digits 2-1 = Small wordlist 2-2 = Large wordlist [challenges/1] extra_tests = Check_Program_Size +[1-1/bc] +skip = Not for bc + +[1-2] +skip = Only for bc + +[1-2/bc] +skip = 0 +exe_args = -l %RUN_FILE +env = BC_LINE_LENGTH=3300 + [2-1/node] line_at_a_time = 1 diff --git a/challenge-004/abigail/t/input-1-2 b/challenge-004/abigail/t/input-1-2 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/challenge-004/abigail/t/output-1-2.exp b/challenge-004/abigail/t/output-1-2.exp new file mode 100644 index 0000000000..9596eb7c20 --- /dev/null +++ b/challenge-004/abigail/t/output-1-2.exp @@ -0,0 +1 @@ +3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117067982148086513282306647093844609550582231725359408128481117450284102701938521105559644622948954930381964428810975665933446128475648233786783165271201909145648566923460348610454326648213393607260249141273724587006606315588174881520920962829254091715364367892590360011330530548820466521384146951941511609433057270365759591953092186117381932611793105118548074462379962749567351885752724891227938183011949129833673362440656643086021394946395224737190702179860943702770539217176293176752384674818467669405132000568127145263560827785771342757789609173637178721468440901224953430146549585371050792279689258923542019956112129021960864034418159813629774771309960518707211349999998372978049951059731732816096318595024459455346908302642522308253344685035261931188171010003137838752886587533208381420617177669147303598253490428755468731159562863882353787593751957781857780532171226806613001927876611195909216420198938095257201065485863278865936153381827968230301952035301852968995773622599413891249721775283479131515574857242454150695950829533116861727855889075098381754637464939319255060400927701671139009848824012858361603563707660104710181942955596198946767837449448255379774726847104047534646208046684259069491293313677028989152104752162056966024058038150193511253382430035587640247496473263914199272604269922796782354781636009341721641219924586315030286182974555706749838505494588586926995690927210797509302955321165344987202755960236480665499119881834797753566369807426542527862551818417574672890977772793800081647060016145249192173217214772350141441973568548161361157352552133475741849468438523323907394143334547762416862518983569485562099219222184272550254256887671790494601653466804988627232791786085784383827967976681454100953883786360950680064225125205117392984896084128488626945604241965285022210661186306744278622039194945047123713786960956364371917287467764657573962413890865832645995813390478027590099465764078951269468398352595709825822620522489407726719478268482601476990902640136394437455305068203496252451749399651431429809190659250937221696461515709858387410597885959772975498930161753928468138268683868942774155991855925245953959431049972524680845987273644695848653836736222626099124608051243884390451244136549762780797715691435997700129616089441694868555848406353422072225828488648158456028506016842739452267467678895252138522549954666727823986456596116354886230577456498035593634568174324112515076069479451096596094025228879710893145669136867228748940560101503308617928680920874760917824938589009714909675985261365549781893129784821682998948722658804857564014270477555132379641451523746234364542858444795265867821051141354735739523113427166102135969536231442952484937187110145765403590279934403742007310578539062198387447808478489683321445713868751943506430218453191048481005370614680674919278191197939952061419663428754440643745123718192179998391015919561814675142691239748940907186494231961567945208095146550225231603881930142093762137855956638937787083039069792077346722182562599661501421503068038447734549202605414665925201497442850732518666002132434088190710486331734649651453905796268561005508106658796998163574736384052571456 -- cgit From b5f0bb3367e23fb81e170d3796d871f5e349877d Mon Sep 17 00:00:00 2001 From: Abigail Date: Fri, 7 Jan 2022 15:44:29 +0100 Subject: Week 4, part 1: Fix 'Run as:' line for Go, Java and Node.js --- challenge-004/abigail/go/ch-1.go | 12 ++++++------ challenge-004/abigail/java/ch-1.java | 4 ++-- challenge-004/abigail/node/ch-1.js | 10 +++++----- 3 files changed, 13 insertions(+), 13 deletions(-) (limited to 'challenge-004') diff --git a/challenge-004/abigail/go/ch-1.go b/challenge-004/abigail/go/ch-1.go index 961f901695..134f8f2c6b 100644 --- a/challenge-004/abigail/go/ch-1.go +++ b/challenge-004/abigail/go/ch-1.go @@ -5,7 +5,7 @@ package main // // -// Run as: go run ch-1.go < input-file +// Run as: go run ch-1.go // import ( @@ -65,9 +65,9 @@ func main () { } // -// FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER -// FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER -// FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER? -// FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER -// FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER! +// FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER, +// FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER, +// FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER? +// FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER: +// FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER! // diff --git a/challenge-004/abigail/java/ch-1.java b/challenge-004/abigail/java/ch-1.java index cba07272da..80322e375c 100644 --- a/challenge-004/abigail/java/ch-1.java +++ b/challenge-004/abigail/java/ch-1.java @@ -3,7 +3,7 @@ // // -// Run as: ln ch-1.java ch1.java; javac ch1.java; java ch1 < input-file +// Run as: ln ch-1.java ch1.java; javac ch1.java; java ch1 // import java.util.*; @@ -63,4 +63,4 @@ public class ch1 { } } -// FODDER FODDER! +// FODDER FODDER FODDER FODDER! diff --git a/challenge-004/abigail/node/ch-1.js b/challenge-004/abigail/node/ch-1.js index aad1be89d3..cc75958b8f 100644 --- a/challenge-004/abigail/node/ch-1.js +++ b/challenge-004/abigail/node/ch-1.js @@ -5,7 +5,7 @@ // // -// Run as: node ch-1.js < input-file +// Run as: node ch-1.js // let pi = "%(uP7+Y`ME)gy(7')v?;%s^qc(Mj1}16idp'ONGs'2m.o,1HLY'}~P61@@Y-" + @@ -67,8 +67,8 @@ process . stdout . write ("\n") // -// FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER -// FODDER FODDER FODDER FODDER FODDER FODDER FODDER -// FODDER FODDER FODDER FODDER FODDER FODDER FODDER -// FODDER FODDER FODDER FODDER FODDER FODDER FODDER +// FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER +// FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER +// FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER +// FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER // -- cgit From 23d627e6ea19493fab5640509b8e97bc74b5082c Mon Sep 17 00:00:00 2001 From: Abigail Date: Fri, 7 Jan 2022 18:19:40 +0100 Subject: Week 4, part 1: Pascal solution --- challenge-004/abigail/README.md | 2 + challenge-004/abigail/pascal/ch-1.p | 73 +++++++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 challenge-004/abigail/pascal/ch-1.p (limited to 'challenge-004') diff --git a/challenge-004/abigail/README.md b/challenge-004/abigail/README.md index 98e4afda0d..3bc8c65c4e 100644 --- a/challenge-004/abigail/README.md +++ b/challenge-004/abigail/README.md @@ -23,11 +23,13 @@ and printing. We may even need to filler comments to make it all work out. ### Solutions * [AWK](awk/ch-1.awk) * [Bash](bash/ch-1.sh) +* [bc](bc/ch-1.bc) * [C](c/ch-1.c) * [Go](go/ch-1.go) * [Java](java/ch-1.java) * [Lua](lua/ch-1.lua) * [Node.js](node/ch-1.node) +* [Pascal](pascal/ch-1.p) * [Perl](perl/ch-1.pl) * [Python](python/ch-1.py) * [Ruby](ruby/ch-1.rb) diff --git a/challenge-004/abigail/pascal/ch-1.p b/challenge-004/abigail/pascal/ch-1.p new file mode 100644 index 0000000000..9578563329 --- /dev/null +++ b/challenge-004/abigail/pascal/ch-1.p @@ -0,0 +1,73 @@ +Program XXX; + +(* *) +(* See https://theweeklychallenge.org/blog/perl-weekly-challenge-004 *) +(* *) + +(* *) +(* Run as: fpc -och-1.out ch-1.p; ./ch-1.out *) +(* *) + +uses + sysutils; + +var + pi: AnsiString; + first, last, skip, dquote, quote, range, ch, i, j, in_size: integer; + out: qword; + +begin + first := ord ('"') + 1; + last := ord ('~'); + skip := ord ('\'); + dquote := ord ('"'); + quote := ord (''''); + range := last - first; + in_size := 5; + pi := '%(uP7+Y`ME)gy(7")v?;%s^qc(Mj1}16idp"ONGs"2m.o,1HLY"}~P61@@Y-' + + '*O/.v,Jc~D+ttA"&EPjR(zXxD$dr,M$P=-f*YQqe,GIZ`0x5oL1(mpl17en`' + + ')Q$ge,L6_5.I;hj%yy6n,L_t")dtyy)[ugS&-3(c&lC:a&~8SP#+iis+WR&8' + + '*Y;V3/+JD@-J>7u0$Nh<#2&:@+#=`/*YtP-0t8uf+tf/V&yjx>+]S=&%d}7z' + + '0YXa9$SOyt$*mzv1&X(W(.{0G-Vya`0a}KI0pQD2,nV0:,WE0+#?F[>(iMb}' + + '%k(tB/UO0m.8R"x%Vys_-|IgL.y-n6(v[*#+/-J1#[`]' + + '&*M#"1wg' + + '-}+B}*jWDi)/2&k,h|/)+eu-3)9{mU-`:]M/YF$a.O0SF0{~2C.EjkZ&>|lD' + + '#%UmL+w)$V&14Ty0arq+%xnAo/XX/y0_=Bl/)f*}"Gc88"GV;X1RG~<+gJ8p' + + '&^E~A"/3N=*R2|j&SgD@-0St?*jL@"-ZsbD$+_hy.#HkF0cO_[#t0wL-8._r' + + '#0)@p#4(ha+lyD6,[|1w%_K//+c2#j.4xl2)SpX=.>)gp$R)ZP,IS%@,}%#J' + + '*1zj[,sIw#%6pwl%D"fk#Bx6"%4?.0&c9"?#R7P|&ZJ;M&q6q&&|h9?0LVI}' + + '(2lq>#/G+<,Bv`l+U"K?"2i}q+,J8W/7dU++X(l51R>#T&)fV0"I%FC%HHkt' + + '%{(NN&Kn$]*e0,' + + '$K`U.%bSL*&dG^f,lN@.+jGbU.g8,s&FwUP$9p3S/)f(4,y>{*/L)t' + + '-Oi$Y*&I1x1Kyk#$}~i|)^4uG%|&sU)XNR-,PLl/.lmT"&_~it-16U9-B~A[' + + '(}s.a0~]Zj*<*~%-~N27%$O,*/a,,c%<#@60On3z0~3@B13UOG/A^&K,GRHi' + + ',S_:*&9I{_$nCM9&U^*9)WmPj+$TL8.]WpP)CWDR$u#7])K/Bi+,[B9(0~a&' + + '&=aag,L-UG#HoAx/=@p,&ux{:0($3X*[J<4,eh{E1F&tE$cGo.&C}15*:u{Z' + + ',:*H^"f,=~$,z%B)WZbL$DjA;/oFKa%.>ig/^o.90e/P=*Auex0TD}p/hncA' + + '/%d87#/u19,r&sM(A+4V0%4u$.}F+P0o|4e.g(<[#5yy*]3@5%II741/XZ>)Lm6e0``3L%.JF[+Z?8b(tj7C' + + '"S/z}#vS|i)S9[=*/nCG)PMaY-{pML);vN?%kRcr#*.Tg,x;42"(1w.0dA)S' + + ')-us%.#1$R-rkwf%m%B-(ctK8+4Sn^%*C1Y-wqsr%eNg11%$De&&07q+%1>-' + + '+mCl2%)V#w%#y:[,?t*D$64`9.U+{`-SBX-+gi/o)0B$q#V$tW+#lmM)";EH' + + '%yFPZ/Gy(~,dl@h)A&ju-Co2,-du++)[Awk&wE}p*H;._.[]4W+Eb7K#iiKB'; + write ('3.'); + i := 1; + while i <= length (pi) do begin + out := 0; + for j := i to i + in_size - 1 do begin + ch := ord (pi [j]); + if ch = dquote then + ch := quote; + out := out * range + ch - first; + if ch > skip then + out := out - 1; + end; + i := i + in_size; + write (format ('%.9D', [out])); + end; + writeln (''); +end. -- cgit From 30f2c751214fba83c926b409ecf60f402fb75b7b Mon Sep 17 00:00:00 2001 From: Abigail Date: Fri, 7 Jan 2022 20:41:21 +0100 Subject: Week 4, part 1. R solution --- challenge-004/abigail/README.md | 1 + challenge-004/abigail/r/ch-1.r | 70 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 challenge-004/abigail/r/ch-1.r (limited to 'challenge-004') diff --git a/challenge-004/abigail/README.md b/challenge-004/abigail/README.md index 3bc8c65c4e..6d83ea003f 100644 --- a/challenge-004/abigail/README.md +++ b/challenge-004/abigail/README.md @@ -32,6 +32,7 @@ and printing. We may even need to filler comments to make it all work out. * [Pascal](pascal/ch-1.p) * [Perl](perl/ch-1.pl) * [Python](python/ch-1.py) +* [R](r/ch-1.r) * [Ruby](ruby/ch-1.rb) diff --git a/challenge-004/abigail/r/ch-1.r b/challenge-004/abigail/r/ch-1.r new file mode 100644 index 0000000000..227256a10f --- /dev/null +++ b/challenge-004/abigail/r/ch-1.r @@ -0,0 +1,70 @@ +#!/usr/local/bin/Rscript + +# +# See https://theweeklychallenge.org/blog/perl-weekly-challenge-004 +# + +# +# Run as: Rscript ch-1.r +# + +first_ord <- as.integer (charToRaw ('"')) + 1 +last_ord <- as.integer (charToRaw ('~')) +skip_ord <- as.integer (charToRaw ('\\')) - first_ord +range <- last_ord - first_ord +in_size <- 5 + +pi <- as.integer (charToRaw (paste ( + "%(uP7+Y`ME)gy(7')v?;%s^qc(Mj1}16idp'ONGs'2m.o,1HLY'}~P61@@Y-", + "*O/.v,Jc~D+ttA'&EPjR(zXxD$dr,M$P=-f*YQqe,GIZ`0x5oL1(mpl17en`", + ")Q$ge,L6_5.I;hj%yy6n,L_t')dtyy)[ugS&-3(c&lC:a&~8SP#+iis+WR&8", + "*Y;V3/+JD@-J>7u0$Nh<#2&:@+#=`/*YtP-0t8uf+tf/V&yjx>+]S=&%d}7z", + "0YXa9$SOyt$*mzv1&X(W(.{0G-Vya`0a}KI0pQD2,nV0:,WE0+#?F[>(iMb}", + "%k(tB/UO0m.8R'x%Vys_-|IgL.y-n6(v[*#+/-J1#[`]", + "&*M#'1wg", + "-}+B}*jWDi)/2&k,h|/)+eu-3)9{mU-`:]M/YF$a.O0SF0{~2C.EjkZ&>|lD", + "#%UmL+w)$V&14Ty0arq+%xnAo/XX/y0_=Bl/)f*}'Gc88'GV;X1RG~<+gJ8p", + "&^E~A'/3N=*R2|j&SgD@-0St?*jL@'-ZsbD$+_hy.#HkF0cO_[#t0wL-8._r", + "#0)@p#4(ha+lyD6,[|1w%_K//+c2#j.4xl2)SpX=.>)gp$R)ZP,IS%@,}%#J", + "*1zj[,sIw#%6pwl%D'fk#Bx6'%4?.0&c9'?#R7P|&ZJ;M&q6q&&|h9?0LVI}", + "(2lq>#/G+<,Bv`l+U'K?'2i}q+,J8W/7dU++X(l51R>#T&)fV0'I%FC%HHkt", + "%{(NN&Kn$]*e0,", + "$K`U.%bSL*&dG^f,lN@.+jGbU.g8,s&FwUP$9p3S/)f(4,y>{*/L)t", + "-Oi$Y*&I1x1Kyk#$}~i|)^4uG%|&sU)XNR-,PLl/.lmT'&_~it-16U9-B~A[", + "(}s.a0~]Zj*<*~%-~N27%$O,*/a,,c%<#@60On3z0~3@B13UOG/A^&K,GRHi", + ",S_:*&9I{_$nCM9&U^*9)WmPj+$TL8.]WpP)CWDR$u#7])K/Bi+,[B9(0~a&", + "&=aag,L-UG#HoAx/=@p,&ux{:0($3X*[J<4,eh{E1F&tE$cGo.&C}15*:u{Z", + ",:*H^'f,=~$,z%B)WZbL$DjA;/oFKa%.>ig/^o.90e/P=*Auex0TD}p/hncA", + "/%d87#/u19,r&sM(A+4V0%4u$.}F+P0o|4e.g(<[#5yy*]3@5%II741/XZ>)Lm6e0``3L%.JF[+Z?8b(tj7C", + "'S/z}#vS|i)S9[=*/nCG)PMaY-{pML);vN?%kRcr#*.Tg,x;42'(1w.0dA)S", + ")-us%.#1$R-rkwf%m%B-(ctK8+4Sn^%*C1Y-wqsr%eNg11%$De&&07q+%1>-", + "+mCl2%)V#w%#y:[,?t*D$64`9.U+{`-SBX-+gi/o)0B$q#V$tW+#lmM)';EH", + "%yFPZ/Gy(~,dl@h)A&ju-Co2,-du++)[Awk&wE}p*H;._.[]4W+Eb7K#iiKB", + sep = '', collapse = ''))) - c (first_ord) + +i <- 1 +cat ("3.") +while (i < length (pi)) { + out <- 0 + for (j in i : (i + in_size - 1)) { + out <- out * range + pi [[j]] + if (pi [[j]] > skip_ord) { + out <- out - 1 + } + } + i <- i + in_size + cat (sprintf ("%09d", out)) +} +cat ("\n") + +# +# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER +# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER +# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER +# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER! +# -- cgit From c605f12d632ce50a7b8e397699dca20927e1b77b Mon Sep 17 00:00:00 2001 From: Abigail Date: Sun, 9 Jan 2022 19:11:00 +0100 Subject: Week 4, part 1: Tcl solution --- challenge-004/abigail/README.md | 1 + challenge-004/abigail/tcl/ch-1.tcl | 75 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 challenge-004/abigail/tcl/ch-1.tcl (limited to 'challenge-004') diff --git a/challenge-004/abigail/README.md b/challenge-004/abigail/README.md index 6d83ea003f..70c4238767 100644 --- a/challenge-004/abigail/README.md +++ b/challenge-004/abigail/README.md @@ -34,6 +34,7 @@ and printing. We may even need to filler comments to make it all work out. * [Python](python/ch-1.py) * [R](r/ch-1.r) * [Ruby](ruby/ch-1.rb) +* [Tcl](tcl/ch-1.tcl) ## [Challenge 2](https://perlweeklychallenge.org/blog/perl-weekly-challenge-004/#challenge-2) diff --git a/challenge-004/abigail/tcl/ch-1.tcl b/challenge-004/abigail/tcl/ch-1.tcl new file mode 100644 index 0000000000..cca5be8f9d --- /dev/null +++ b/challenge-004/abigail/tcl/ch-1.tcl @@ -0,0 +1,75 @@ +#!/usr/local/opt/tcl-tk/bin/tclsh + +# +# See https://theweeklychallenge.org/blog/perl-weekly-challenge-004 +# + +# +# Run as: tclsh ch-1.tcl +# + +# +# " -> } +# ! -> { +# + +scan "#" %c first_ord +scan "~" %c last_ord +scan "\\" %c skip_ord + +set range [expr $last_ord - $first_ord] +set in_size 5 + +append pi {%(uP7+Y`ME)gy(7')v?;%s^qc(Mj1"16idp'ONGs'2m.o,1HLY'"~P61@@Y-} \ + {*O/.v,Jc~D+ttA'&EPjR(zXxD$dr,M$P=-f*YQqe,GIZ`0x5oL1(mpl17en`} \ + {)Q$ge,L6_5.I;hj%yy6n,L_t')dtyy)[ugS&-3(c&lC:a&~8SP#+iis+WR&8} \ + {*Y;V3/+JD@-J>7u0$Nh<#2&:@+#=`/*YtP-0t8uf+tf/V&yjx>+]S=&%d"7z} \ + {0YXa9$SOyt$*mzv1&X(W(.!0G-Vya`0a"KI0pQD2,nV0:,WE0+#?F[>(iMb"} \ + {%k(tB/UO0m.8R'x%Vys_-|IgL.y-n6(v[*#+/-J1#[`]} \ + {&*M#'1wg} \ + {-"+B"*jWDi)/2&k,h|/)+eu-3)9!mU-`:]M/YF$a.O0SF0!~2C.EjkZ&>|lD} \ + {#%UmL+w)$V&14Ty0arq+%xnAo/XX/y0_=Bl/)f*"'Gc88'GV;X1RG~<+gJ8p} \ + {&^E~A'/3N=*R2|j&SgD@-0St?*jL@'-ZsbD$+_hy.#HkF0cO_[#t0wL-8._r} \ + {#0)@p#4(ha+lyD6,[|1w%_K//+c2#j.4xl2)SpX=.>)gp$R)ZP,IS%@,"%#J} \ + {*1zj[,sIw#%6pwl%D'fk#Bx6'%4?.0&c9'?#R7P|&ZJ;M&q6q&&|h9?0LVI"} \ + {(2lq>#/G+<,Bv`l+U'K?'2i"q+,J8W/7dU++X(l51R>#T&)fV0'I%FC%HHkt} \ + {%!(NN&Kn$]*e0,} \ + {$K`U.%bSL*&dG^f,lN@.+jGbU.g8,s&FwUP$9p3S/)f(4,y>!*/L)t} \ + {-Oi$Y*&I1x1Kyk#$"~i|)^4uG%|&sU)XNR-,PLl/.lmT'&_~it-16U9-B~A[} \ + {("s.a0~]Zj*<*~%-~N27%$O,*/a,,c%<#@60On3z0~3@B13UOG/A^&K,GRHi} \ + {,S_:*&9I!_$nCM9&U^*9)WmPj+$TL8.]WpP)CWDR$u#7])K/Bi+,[B9(0~a&} \ + {&=aag,L-UG#HoAx/=@p,&ux!:0($3X*[J<4,eh!E1F&tE$cGo.&C"15*:u!Z} \ + {,:*H^'f,=~$,z%B)WZbL$DjA;/oFKa%.>ig/^o.90e/P=*Auex0TD"p/hncA} \ + {/%d87#/u19,r&sM(A+4V0%4u$."F+P0o|4e.g(<[#5yy*]3@5%II741/XZ>)Lm6e0``3L%.JF[+Z?8b(tj7C} \ + {'S/z"#vS|i)S9[=*/nCG)PMaY-!pML);vN?%kRcr#*.Tg,x;42'(1w.0dA)S} \ + {)-us%.#1$R-rkwf%m%B-(ctK8+4Sn^%*C1Y-wqsr%eNg11%$De&&07q+%1>-} \ + {+mCl2%)V#w%#y:[,?t*D$64`9.U+!`-SBX-+gi/o)0B$q#V$tW+#lmM)';EH} \ + {%yFPZ/Gy(~,dl@h)A&ju-Co2,-du++)[Awk&wE"p*H;._.[]4W+Eb7K#iiKB} + +set pi [string map {"!" "\{" {"} "\}"} $pi] + +puts -nonewline "3." +for {set i 0} {$i < [string length $pi]} {incr i $in_size} { + set out 0 + for {set j $i} {$j < [expr $i + $in_size]} {incr j} { + scan [string index $pi $j] %c ch + if {$ch > $skip_ord} {incr ch -1} + set out [expr $out * $range + $ch - $first_ord] + } + puts -nonewline [format "%09d" $out] +} + +puts "" + +# +# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER +# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER +# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER? +# FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER +# FODDER FODDER FODDER FODDER FODDER FODDER! +# -- cgit From 09692c13e2440d4d595ff782690e99bdf9c01d5e Mon Sep 17 00:00:00 2001 From: Abigail Date: Sun, 9 Jan 2022 21:38:15 +0100 Subject: Week 4, part: Scheme solution --- challenge-004/abigail/scheme/ch-1.scm | 82 +++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 challenge-004/abigail/scheme/ch-1.scm (limited to 'challenge-004') diff --git a/challenge-004/abigail/scheme/ch-1.scm b/challenge-004/abigail/scheme/ch-1.scm new file mode 100644 index 0000000000..37ebac267f --- /dev/null +++ b/challenge-004/abigail/scheme/ch-1.scm @@ -0,0 +1,82 @@ +#!/usr/local/bin/guile +!# + +;;; +;;; See https://theweeklychallenge.org/blog/perl-weekly-challenge-004 +;;; + +;;; +;;; Run as: guile --no-auto-compile ch-1.scm +;;; + +(use-modules (ice-9 format)) + +(define first_ord (char->integer #\#)) +(define last_ord (char->integer #\~)) +(define skip_ord (char->integer #\\)) +(define range (- last_ord first_ord)) +(define in_size 5) + +(define pi (map-in-order char->integer (string->list (string-append + "%(uP7+Y`ME)gy(7')v?;%s^qc(Mj1}16idp'ONGs'2m.o,1HLY'}~P61@@Y-" + "*O/.v,Jc~D+ttA'&EPjR(zXxD$dr,M$P=-f*YQqe,GIZ`0x5oL1(mpl17en`" + ")Q$ge,L6_5.I;hj%yy6n,L_t')dtyy)[ugS&-3(c&lC:a&~8SP#+iis+WR&8" + "*Y;V3/+JD@-J>7u0$Nh<#2&:@+#=`/*YtP-0t8uf+tf/V&yjx>+]S=&%d}7z" + "0YXa9$SOyt$*mzv1&X(W(.{0G-Vya`0a}KI0pQD2,nV0:,WE0+#?F[>(iMb}" + "%k(tB/UO0m.8R'x%Vys_-|IgL.y-n6(v[*#+/-J1#[`]" + "&*M#'1wg" + "-}+B}*jWDi)/2&k,h|/)+eu-3)9{mU-`:]M/YF$a.O0SF0{~2C.EjkZ&>|lD" + "#%UmL+w)$V&14Ty0arq+%xnAo/XX/y0_=Bl/)f*}'Gc88'GV;X1RG~<+gJ8p" + "&^E~A'/3N=*R2|j&SgD@-0St?*jL@'-ZsbD$+_hy.#HkF0cO_[#t0wL-8._r" + "#0)@p#4(ha+lyD6,[|1w%_K//+c2#j.4xl2)SpX=.>)gp$R)ZP,IS%@,}%#J" + "*1zj[,sIw#%6pwl%D'fk#Bx6'%4?.0&c9'?#R7P|&ZJ;M&q6q&&|h9?0LVI}" + "(2lq>#/G+<,Bv`l+U'K?'2i}q+,J8W/7dU++X(l51R>#T&)fV0'I%FC%HHkt" + "%{(NN&Kn$]*e0," + "$K`U.%bSL*&dG^f,lN@.+jGbU.g8,s&FwUP$9p3S/)f(4,y>{*/L)t" + "-Oi$Y*&I1x1Kyk#$}~i|)^4uG%|&sU)XNR-,PLl/.lmT'&_~it-16U9-B~A[" + "(}s.a0~]Zj*<*~%-~N27%$O,*/a,,c%<#@60On3z0~3@B13UOG/A^&K,GRHi" + ",S_:*&9I{_$nCM9&U^*9)WmPj+$TL8.]WpP)CWDR$u#7])K/Bi+,[B9(0~a&" + "&=aag,L-UG#HoAx/=@p,&ux{:0($3X*[J<4,eh{E1F&tE$cGo.&C}15*:u{Z" + ",:*H^'f,=~$,z%B)WZbL$DjA;/oFKa%.>ig/^o.90e/P=*Auex0TD}p/hncA" + "/%d87#/u19,r&sM(A+4V0%4u$.}F+P0o|4e.g(<[#5yy*]3@5%II741/XZ>)Lm6e0``3L%.JF[+Z?8b(tj7C" + "'S/z}#vS|i)S9[=*/nCG)PMaY-{pML);vN?%kRcr#*.Tg,x;42'(1w.0dA)S" + ")-us%.#1$R-rkwf%m%B-(ctK8+4Sn^%*C1Y-wqsr%eNg11%$De&&07q+%1>-" + "+mCl2%)V#w%#y:[,?t*D$64`9.U+{`-SBX-+gi/o)0B$q#V$tW+#lmM)';EH" + "%yFPZ/Gy(~,dl@h)A&ju-Co2,-du++)[Awk&wE}p*H;._.[]4W+Eb7K#iiKB")))) + + +(define (decode out chars) + (if (= (length chars) 0) (format #t "~9,'0d" out) + (decode (+ (* out range) + (- first_ord) + (car chars) + (if (> (car chars) skip_ord) -1 0)) + (cdr chars)))) + + +(define (topi pi) + (if (> (length pi) 0) + (begin + (decode 0 (list-head pi in_size)) + (topi (list-tail pi in_size)) + ) + ) +) + +(display "3.") +(topi pi) +(newline) + + +;;; +;;; FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER +;;; FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER +;;; FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER +;;; FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER +;;; FODDER FODDER FODDER FODDER FODDER FODDER FODDER FODDER +;;; -- cgit From 395f87e5947194f9cd61a8e48fb04fd30bfc14d7 Mon Sep 17 00:00:00 2001 From: Abigail Date: Sun, 9 Jan 2022 21:54:05 +0100 Subject: Week 4, part 1: All languages should give the same result. Make we all languages have the same rounding issues. --- challenge-004/abigail/README.md | 1 + challenge-004/abigail/awk/ch-1.awk | 2 +- challenge-004/abigail/bash/ch-1.sh | 2 +- challenge-004/abigail/c/ch-1.c | 2 +- challenge-004/abigail/go/ch-1.go | 2 +- challenge-004/abigail/java/ch-1.java | 2 +- challenge-004/abigail/lua/ch-1.lua | 2 +- challenge-004/abigail/node/ch-1.js | 2 +- challenge-004/abigail/pascal/ch-1.p | 2 +- challenge-004/abigail/perl/ch-1.pl | 2 +- challenge-004/abigail/python/ch-1.py | 2 +- challenge-004/abigail/r/ch-1.r | 2 +- challenge-004/abigail/ruby/ch-1.rb | 2 +- challenge-004/abigail/scheme/ch-1.scm | 2 +- challenge-004/abigail/t/ctest.ini | 8 -------- challenge-004/abigail/t/input-1-2 | 0 challenge-004/abigail/t/output-1-1.exp | 2 +- challenge-004/abigail/t/output-1-2.exp | 1 - challenge-004/abigail/tcl/ch-1.tcl | 2 +- 19 files changed, 16 insertions(+), 24 deletions(-) delete mode 100644 challenge-004/abigail/t/input-1-2 delete mode 100644 challenge-004/abigail/t/output-1-2.exp (limited to 'challenge-004') diff --git a/challenge-004/abigail/README.md b/challenge-004/abigail/README.md index 70c4238767..8cfd5b4918 100644 --- a/challenge-004/abigail/README.md +++ b/challenge-004/abigail/README.md @@ -34,6 +34,7 @@ and printing. We may even need to filler comments to make it all work out. * [Python](python/ch-1.py) * [R](r/ch-1.r) * [Ruby](ruby/ch-1.rb) +* [Scheme](scheme/ch-1.scm) * [Tcl](tcl/ch-1.tcl) diff --git a/challenge-004/abigail/awk/ch-1.awk b/challenge-004/abigail/awk/ch-1.awk index ef3e23fbf5..36fec0b98f 100644 --- a/challenge-004/abigail/awk/ch-1.awk +++ b/challenge-004/abigail/awk/ch-1.awk @@ -48,7 +48,7 @@ BEGIN { "'S/z}#vS|i)S9[=*/nCG)PMaY-{pML);vN?%kRcr#*.Tg,x;42'(1w.0dA)S" \ ")-us%.#1$R-rkwf%m%B-(ctK8+4Sn^%*C1Y-wqsr%eNg11%$De&&07q+%1>-" \ "+mCl2%)V#w%#y:[,?t*D$64`9.U+{`-SBX-+gi/o)0B$q#V$tW+#lmM)';EH" \ - "%yFPZ/Gy(~,dl@h)A&ju-Co2,-du++)[Awk&wE}p*H;._.[]4W+Eb7K#iiKB" + "%yFPZ/Gy(~,dl@h)A&ju-Co2,-du++)[Awk&wE}p*H;._.[]4W+Eb7K#iiK?" printf ("3.") format = "%0" out_size "d" for (i = 1; i <= length (line); i += in_size) { diff --git a/challenge-004/abigail/bash/ch-1.sh b/challenge-004/abigail/bash/ch-1.sh index 090463de8e..6dfa72a723 100644 --- a/challenge-004/abigail/bash/ch-1.sh +++ b/challenge-004/abigail/bash/ch-1.sh @@ -61,7 +61,7 @@ $K`U.%bSL*&dG^f,lN@.+jGbU.g8,s&FwUP$9p3S/)f(4,y>- +mCl2%)V#w%#y:[,?t*D$64`9.U+{`-SBX-+gi/o)0B$q#V$tW+#lmM)';EH -%yFPZ/Gy(~,dl@h)A&ju-Co2,-du++)[Awk&wE}p*H;._.[]4W+Eb7K#iiKB +%yFPZ/Gy(~,dl@h)A&ju-Co2,-du++)[Awk&wE}p*H;._.[]4W+Eb7K#iiK? -- echo diff --git a/challenge-004/abigail/c/ch-1.c b/challenge-004/abigail/c/ch-1.c index a4bd327725..89ee6b0e96 100644 --- a/challenge-004/abigail/c/ch-1.c +++ b/challenge-004/abigail/c/ch-1.c @@ -48,7 +48,7 @@ int main (void) { "'S/z}#vS|i)S9[=*/nCG)PMaY-{pML);vN?%kRcr#*.Tg,x;42'(1w.0dA)S" \ ")-us%.#1$R-rkwf%m%B-(ctK8+4Sn^%*C1Y-wqsr%eNg11%$De&&07q+%1>-" \ "+mCl2%)V#w%#y:[,?t*D$64`9.U+{`-SBX-+gi/o)0B$q#V$tW+#lmM)';EH" \ - "%yFPZ/Gy(~,dl@h)A&ju-Co2,-du++)[Awk&wE}p*H;._.[]4W+Eb7K#iiKB"; + "%yFPZ/Gy(~,dl@h)A&ju-Co2,-du++)[Awk&wE}p*H;._.[]4W+Eb7K#iiK?"; printf ("3."); size_t l = strlen (pi); for (size_t i = 0; i < l; i += in_size) { diff --git a/challenge-004/abigail/go/ch-1.go b/challenge-004/abigail/go/ch-1.go index 134f8f2c6b..757181e876 100644 --- a/challenge-004/abigail/go/ch-1.go +++ b/challenge-004/abigail/go/ch-1.go @@ -48,7 +48,7 @@ func main () { "'S/z}#vS|i)S9[=*/nCG)PMaY-{pML);vN?%kRcr#*.Tg,x;42'(1w.0dA)S" + ")-us%.#1$R-rkwf%m%B-(ctK8+4Sn^%*C1Y-wqsr%eNg11%$De&&07q+%1>-" + "+mCl2%)V#w%#y:[,?t*D$64`9.U+{`-SBX-+gi/o)0B$q#V$tW+#lmM)';EH" + - "%yFPZ/Gy(~,dl@h)A&ju-Co2,-du++)[Awk&wE}p*H;._.[]4W+Eb7K#iiKB") + "%yFPZ/Gy(~,dl@h)A&ju-Co2,-du++)[Awk&wE}p*H;._.[]4W+Eb7K#iiK?") fmt . Print ("3.") for i := 0; i < len (pi); i += in_size { out := 0 diff --git a/challenge-004/abigail/java/ch-1.java b/challenge-004/abigail/java/ch-1.java index 80322e375c..c93f31fb28 100644 --- a/challenge-004/abigail/java/ch-1.java +++ b/challenge-004/abigail/java/ch-1.java @@ -45,7 +45,7 @@ public class ch1 { "'S/z}#vS|i)S9[=*/nCG)PMaY-{pML);vN?%kRcr#*.Tg,x;42'(1w.0dA)S" + ")-us%.#1$R-rkwf%m%B-(ctK8+4Sn^%*C1Y-wqsr%eNg11%$De&&07q+%1>-" + "+mCl2%)V#w%#y:[,?t*D$64`9.U+{`-SBX-+gi/o)0B$q#V$tW+#lmM)';EH" + - "%yFPZ/Gy(~,dl@h)A&ju-Co2,-du++)[Awk&wE}p*H;._.[]4W+Eb7K#iiKB") . + "%yFPZ/Gy(~,dl@h)A&ju-Co2,-du++)[Awk&wE}p*H;._.[]4W+Eb7K#iiK?") . toCharArray (); System . out . print ("3."); for (int i = 0; i < pi . length; i += in_size) { diff --git a/challenge-004/abigail/lua/ch-1.lua b/challenge-004/abigail/lua/ch-1.lua index f8f39b4135..a2fb3d0b2b 100644 --- a/challenge-004/abigail/lua/ch-1.lua +++ b/challenge-004/abigail/lua/ch-1.lua @@ -37,7 +37,7 @@ local pi = "%(uP7+Y`ME)gy(7')v?;%s^qc(Mj1}16idp'ONGs'2m.o,1HLY'}~P61@@Y-" .. "'S/z}#vS|i)S9[=*/nCG)PMaY-{pML);vN?%kRcr#*.Tg,x;42'(1w.0dA)S" .. ")-us%.#1$R-rkwf%m%B-(ctK8+4Sn^%*C1Y-wqsr%eNg11%$De&&07q+%1>-" .. "+mCl2%)V#w%#y:[,?t*D$64`9.U+{`-SBX-+gi/o)0B$q#V$tW+#lmM)';EH" .. - "%yFPZ/Gy(~,dl@h)A&ju-Co2,-du++)[Awk&wE}p*H;._.[]4W+Eb7K#iiKB"; + "%yFPZ/Gy(~,dl@h)A&ju-Co2,-du++)[Awk&wE}p*H;._.[]4W+Eb7K#iiK?"; local in_size = 5 local out_size = 9 diff --git a/challenge-004/abigail/node/ch-1.js b/challenge-004/abigail/node/ch-1.js index cc75958b8f..5316f4660d 100644 --- a/challenge-004/abigail/node/ch-1.js +++ b/challenge-004/abigail/node/ch-1.js @@ -37,7 +37,7 @@ let pi = "%(uP7+Y`ME)gy(7')v?;%s^qc(Mj1}16idp'ONGs'2m.o,1HLY'}~P61@@Y-" + "'S/z}#vS|i)S9[=*/nCG)PMaY-{pML);vN?%kRcr#*.Tg,x;42'(1w.0dA)S" + ")-us%.#1$R-rkwf%m%B-(ctK8+4Sn^%*C1Y-wqsr%eNg11%$De&&07q+%1>-" + "+mCl2%)V#w%#y:[,?t*D$64`9.U+{`-SBX-+gi/o)0B$q#V$tW+#lmM)';EH" + - "%yFPZ/Gy(~,dl@h)A&ju-Co2,-du++)[Awk&wE}p*H;._.[]4W+Eb7K#iiKB"; + "%yFPZ/Gy(~,dl@h)A&ju-Co2,-du++)[Awk&wE}p*H;._.[]4W+Eb7K#iiK?"; let printf = require ('printf') diff --git a/challenge-004/abigail/pascal/ch-1.p b/challenge-004/abigail/pascal/ch-1.p index 9578563329..4a36a15995 100644 --- a/challenge-004/abigail/pascal/ch-1.p +++ b/challenge-004/abigail/pascal/ch-1.p @@ -53,7 +53,7 @@ begin '"S/z}#vS|i)S9[=*/nCG)PMaY-{pML);vN?%kRcr#*.Tg,x;42"(1w.0dA)S' + ')-us%.#1$R-rkwf%m%B-(ctK8+4Sn^%*C1Y-wqsr%eNg11%$De&&07q+%1>-' + '+mCl2%)V#w%#y:[,?t*D$64`9.U+{`-SBX-+gi/o)0B$q#V$tW+#lmM)";EH' + - '%yFPZ/Gy(~,dl@h)A&ju-Co2,-du++)[Awk&wE}p*H;._.[]4W+Eb7K#iiKB'; + '%yFPZ/Gy(~,dl@h)A&ju-Co2,-du++)[Awk&wE}p*H;._.[]4W+Eb7K#iiK?'; write ('3.'); i := 1; while i <= length (pi) do begin diff --git a/challenge-004/abigail/perl/ch-1.pl b/challenge-004/abigail/perl/ch-1.pl index 1921bd3903..7a8e5a1669 100644 --- a/challenge-004/abigail/perl/ch-1.pl +++ b/challenge-004/abigail/perl/ch-1.pl @@ -87,4 +87,4 @@ $K`U.%bSL*&dG^f,lN@.+jGbU.g8,s&FwUP$9p3S/)f(4,y>- +mCl2%)V#w%#y:[,?t*D$64`9.U+{`-SBX-+gi/o)0B$q#V$tW+#lmM)';EH -%yFPZ/Gy(~,dl@h)A&ju-Co2,-du++)[Awk&wE}p*H;._.[]4W+Eb7K#iiKB +%yFPZ/Gy(~,dl@h)A&ju-Co2,-du++)[Awk&wE}p*H;._.[]4W+Eb7K#iiK? diff --git a/challenge-004/abigail/python/ch-1.py b/challenge-004/abigail/python/ch-1.py index af5d05111a..1bc0fa720b 100644 --- a/challenge-004/abigail/python/ch-1.py +++ b/challenge-004/abigail/python/ch-1.py @@ -39,7 +39,7 @@ pi = "%(uP7+Y`ME)gy(7')v?;%s^qc(Mj1}16idp'ONGs'2m.o,1HLY'}~P61@@Y-" + \ "'S/z}#vS|i)S9[=*/nCG)PMaY-{pML);vN?%kRcr#*.Tg,x;42'(1w.0dA)S" + \ ")-us%.#1$R-rkwf%m%B-(ctK8+4Sn^%*C1Y-wqsr%eNg11%$De&&07q+%1>-" + \ "+mCl2%)V#w%#y:[,?t*D$64`9.U+{`-SBX-+gi/o)0B$q#V$tW+#lmM)';EH" + \ - "%yFPZ/Gy(~,dl@h)A&ju-Co2,-du++)[Awk&wE}p*H;._.[]4W+Eb7K#iiKB"; + "%yFPZ/Gy(~,dl@h)A&ju-Co2,-du++)[Awk&wE}p*H;._.[]4W+Eb7K#iiK?"; in_size = 5 diff --git a/challenge-004/abigail/r/ch-1.r b/challenge-004/abigail/r/ch-1.r index 227256a10f..947a026b9f 100644 --- a/challenge-004/abigail/r/ch-1.r +++ b/challenge-004/abigail/r/ch-1.r @@ -44,7 +44,7 @@ pi <- as.integer (charToRaw (paste ( "'S/z}#vS|i)S9[=*/nCG)PMaY-{pML);vN?%kRcr#*.Tg,x;42'(1w.0dA)S", ")-us%.#1$R-rkwf%m%B-(ctK8+4Sn^%*C1Y-wqsr%eNg11%$De&&07q+%1>-", "+mCl2%)V#w%#y:[,?t*D$64`9.U+{`-SBX-+gi/o)0B$q#V$tW+#lmM)';EH", - "%yFPZ/Gy(~,dl@h)A&ju-Co2,-du++)[Awk&wE}p*H;._.[]4W+Eb7K#iiKB", + "%yFPZ/Gy(~,dl@h)A&ju-Co2,-du++)[Awk&wE}p*H;._.[]4W+Eb7K#iiK?", sep = '', collapse = ''))) - c (first_ord) i <- 1 diff --git a/challenge-004/abigail/ruby/ch-1.rb b/challenge-004/abigail/ruby/ch-1.rb index a5af29eeb0..6f7a2a6304 100644 --- a/challenge-004/abigail/ruby/ch-1.rb +++ b/challenge-004/abigail/ruby/ch-1.rb @@ -37,7 +37,7 @@ pi = "%(uP7+Y`ME)gy(7')v?;%s^qc(Mj1}16idp'ONGs'2m.o,1HLY'}~P61@@Y-" + "'S/z}#vS|i)S9[=*/nCG)PMaY-{pML);vN?%kRcr#*.Tg,x;42'(1w.0dA)S" + ")-us%.#1$R-rkwf%m%B-(ctK8+4Sn^%*C1Y-wqsr%eNg11%$De&&07q+%1>-" + "+mCl2%)V#w%#y:[,?t*D$64`9.U+{`-SBX-+gi/o)0B$q#V$tW+#lmM)';EH" + - "%yFPZ/Gy(~,dl@h)A&ju-Co2,-du++)[Awk&wE}p*H;._.[]4W+Eb7K#iiKB" + "%yFPZ/Gy(~,dl@h)A&ju-Co2,-du++)[Awk&wE}p*H;._.[]4W+Eb7K#iiK?" in_size = 5 out_size = 9 diff --git a/challenge-004/abigail/scheme/ch-1.scm b/challenge-004/abigail/scheme/ch-1.scm index 37ebac267f..f7bfbc7144 100644 --- a/challenge-004/abigail/scheme/ch-1.scm +++ b/challenge-004/abigail/scheme/ch-1.scm @@ -47,7 +47,7 @@ "'S/z}#vS|i)S9[=*/nCG)PMaY-{pML);vN?%kRcr#*.Tg,x;42'(1w.0dA)S" ")-us%.#1$R-rkwf%m%B-(ctK8+4Sn^%*C1Y-wqsr%eNg11%$De&&07q+%1>-" "+mCl2%)V#w%#y:[,?t*D$64`9.U+{`-SBX-+gi/o)0B$q#V$tW+#lmM)';EH" - "%yFPZ/Gy(~,dl@h)A&ju-Co2,-du++)[Awk&wE}p*H;._.[]4W+Eb7K#iiKB")))) + "%yFPZ/Gy(~,dl@h)A&ju-Co2,-du++)[Awk&wE}p*H;._.[]4W+Eb7K#iiK?")))) (define (decode out chars) diff --git a/challenge-004/abigail/t/ctest.ini b/challenge-004/abigail/t/ctest.ini index c72f82b193..8ce6c4c482 100644 --- a/challenge-004/abigail/t/ctest.ini +++ b/challenge-004/abigail/t/ctest.ini @@ -1,6 +1,5 @@ [names] 1-1 = Pi, 3242 digits -1-2 = Pi, 3242 digits 2-1 = Small wordlist 2-2 = Large wordlist @@ -8,13 +7,6 @@ extra_tests = Check_Program_Size [1-1/bc] -skip = Not for bc - -[1-2] -skip = Only for bc - -[1-2/bc] -skip = 0 exe_args = -l %RUN_FILE env = BC_LINE_LENGTH=3300 diff --git a/challenge-004/abigail/t/input-1-2 b/challenge-004/abigail/t/input-1-2 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/challenge-004/abigail/t/output-1-1.exp b/challenge-004/abigail/t/output-1-1.exp index 574e7ee129..9596eb7c20 100644 --- a/challenge-004/abigail/t/output-1-1.exp +++ b/challenge-004/abigail/t/output-1-1.exp @@ -1 +1 @@ -3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117067982148086513282306647093844609550582231725359408128481117450284102701938521105559644622948954930381964428810975665933446128475648233786783165271201909145648566923460348610454326648213393607260249141273724587006606315588174881520920962829254091715364367892590360011330530548820466521384146951941511609433057270365759591953092186117381932611793105118548074462379962749567351885752724891227938183011949129833673362440656643086021394946395224737190702179860943702770539217176293176752384674818467669405132000568127145263560827785771342757789609173637178721468440901224953430146549585371050792279689258923542019956112129021960864034418159813629774771309960518707211349999998372978049951059731732816096318595024459455346908302642522308253344685035261931188171010003137838752886587533208381420617177669147303598253490428755468731159562863882353787593751957781857780532171226806613001927876611195909216420198938095257201065485863278865936153381827968230301952035301852968995773622599413891249721775283479131515574857242454150695950829533116861727855889075098381754637464939319255060400927701671139009848824012858361603563707660104710181942955596198946767837449448255379774726847104047534646208046684259069491293313677028989152104752162056966024058038150193511253382430035587640247496473263914199272604269922796782354781636009341721641219924586315030286182974555706749838505494588586926995690927210797509302955321165344987202755960236480665499119881834797753566369807426542527862551818417574672890977772793800081647060016145249192173217214772350141441973568548161361157352552133475741849468438523323907394143334547762416862518983569485562099219222184272550254256887671790494601653466804988627232791786085784383827967976681454100953883786360950680064225125205117392984896084128488626945604241965285022210661186306744278622039194945047123713786960956364371917287467764657573962413890865832645995813390478027590099465764078951269468398352595709825822620522489407726719478268482601476990902640136394437455305068203496252451749399651431429809190659250937221696461515709858387410597885959772975498930161753928468138268683868942774155991855925245953959431049972524680845987273644695848653836736222626099124608051243884390451244136549762780797715691435997700129616089441694868555848406353422072225828488648158456028506016842739452267467678895252138522549954666727823986456596116354886230577456498035593634568174324112515076069479451096596094025228879710893145669136867228748940560101503308617928680920874760917824938589009714909675985261365549781893129784821682998948722658804857564014270477555132379641451523746234364542858444795265867821051141354735739523113427166102135969536231442952484937187110145765403590279934403742007310578539062198387447808478489683321445713868751943506430218453191048481005370614680674919278191197939952061419663428754440643745123718192179998391015919561814675142691239748940907186494231961567945208095146550225231603881930142093762137855956638937787083039069792077346722182562599661501421503068038447734549202605414665925201497442850732518666002132434088190710486331734649651453905796268561005508106658796998163574736384052571459 +3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117067982148086513282306647093844609550582231725359408128481117450284102701938521105559644622948954930381964428810975665933446128475648233786783165271201909145648566923460348610454326648213393607260249141273724587006606315588174881520920962829254091715364367892590360011330530548820466521384146951941511609433057270365759591953092186117381932611793105118548074462379962749567351885752724891227938183011949129833673362440656643086021394946395224737190702179860943702770539217176293176752384674818467669405132000568127145263560827785771342757789609173637178721468440901224953430146549585371050792279689258923542019956112129021960864034418159813629774771309960518707211349999998372978049951059731732816096318595024459455346908302642522308253344685035261931188171010003137838752886587533208381420617177669147303598253490428755468731159562863882353787593751957781857780532171226806613001927876611195909216420198938095257201065485863278865936153381827968230301952035301852968995773622599413891249721775283479131515574857242454150695950829533116861727855889075098381754637464939319255060400927701671139009848824012858361603563707660104710181942955596198946767837449448255379774726847104047534646208046684259069491293313677028989152104752162056966024058038150193511253382430035587640247496473263914199272604269922796782354781636009341721641219924586315030286182974555706749838505494588586926995690927210797509302955321165344987202755960236480665499119881834797753566369807426542527862551818417574672890977772793800081647060016145249192173217214772350141