From 7bd3ebe6f8e3bfb11a92af54aad975b34888049e Mon Sep 17 00:00:00 2001 From: Paulo Custodio Date: Wed, 23 Jun 2021 23:36:00 +0100 Subject: Add bc solution to challenge 006 --- challenge-001/paulo-custodio/test.pl | 2 +- challenge-006/paulo-custodio/bc/ch-2.bc | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 challenge-006/paulo-custodio/bc/ch-2.bc 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 -- cgit