diff options
| author | Paulo Custodio <pauloscustodio@gmail.com> | 2021-06-23 23:36:00 +0100 |
|---|---|---|
| committer | Paulo Custodio <pauloscustodio@gmail.com> | 2021-06-23 23:36:00 +0100 |
| commit | 7bd3ebe6f8e3bfb11a92af54aad975b34888049e (patch) | |
| tree | 03a17aaa2dfa635ef9e10589a7ba911cfc3d6071 | |
| parent | d7b93ace6d641c21bd1fc5815b4d1f68f1235d52 (diff) | |
| download | perlweeklychallenge-club-7bd3ebe6f8e3bfb11a92af54aad975b34888049e.tar.gz perlweeklychallenge-club-7bd3ebe6f8e3bfb11a92af54aad975b34888049e.tar.bz2 perlweeklychallenge-club-7bd3ebe6f8e3bfb11a92af54aad975b34888049e.zip | |
Add bc solution to challenge 006
| -rw-r--r-- | challenge-001/paulo-custodio/test.pl | 2 | ||||
| -rw-r--r-- | challenge-006/paulo-custodio/bc/ch-2.bc | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/challenge-001/paulo-custodio/test.pl b/challenge-001/paulo-custodio/test.pl index a8a46745f3..2bc0715c09 100644 --- a/challenge-001/paulo-custodio/test.pl +++ b/challenge-001/paulo-custodio/test.pl @@ -68,7 +68,7 @@ for my $lang (grep {-d} sort keys %LANG) { # build test command line my $cmd; if ($lang eq 'bc') { # needs args in stdin - $cmd = "echo ".$spec->{args}."|$exec"; + $cmd = "echo ".($spec->{args}//"")."|$exec"; } else { $cmd = "$exec ".value_or_eval($spec->{args}); diff --git a/challenge-006/paulo-custodio/bc/ch-2.bc b/challenge-006/paulo-custodio/bc/ch-2.bc new file mode 100644 index 0000000000..631718706d --- /dev/null +++ b/challenge-006/paulo-custodio/bc/ch-2.bc @@ -0,0 +1,8 @@ +#!/usr/bin/bc -ql +scale=100 +pi=4*a(1) +ex=pi*sqrt(163) +rk=e(ex) +scale=12 +rk/1 +quit
\ No newline at end of file |
