aboutsummaryrefslogtreecommitdiff
path: root/challenge-246
diff options
context:
space:
mode:
authorMohammad Sajid Anwar <Mohammad.Anwar@yahoo.com>2023-12-06 10:45:36 +0000
committerGitHub <noreply@github.com>2023-12-06 10:45:36 +0000
commitc475a39f6457fd6bb71f04704e667841d5af40b0 (patch)
treedf1fc79c6443d734a92ebf0da58ad2a40986b936 /challenge-246
parent2ed9f7503a4c95780801a467173731576347ad75 (diff)
parent5af36a7698c988cadd730f4b43fc369feab365c1 (diff)
downloadperlweeklychallenge-club-c475a39f6457fd6bb71f04704e667841d5af40b0.tar.gz
perlweeklychallenge-club-c475a39f6457fd6bb71f04704e667841d5af40b0.tar.bz2
perlweeklychallenge-club-c475a39f6457fd6bb71f04704e667841d5af40b0.zip
Merge pull request #9204 from E7-87-83/newt
fix ch-2.pl of Week 246
Diffstat (limited to 'challenge-246')
-rw-r--r--challenge-246/cheok-yin-fung/blog.txt1
-rw-r--r--challenge-246/cheok-yin-fung/perl/ch-2.pl5
2 files changed, 4 insertions, 2 deletions
diff --git a/challenge-246/cheok-yin-fung/blog.txt b/challenge-246/cheok-yin-fung/blog.txt
new file mode 100644
index 0000000000..c44901c6bc
--- /dev/null
+++ b/challenge-246/cheok-yin-fung/blog.txt
@@ -0,0 +1 @@
+https://e7-87-83.github.io/coding/challenge_246.html
diff --git a/challenge-246/cheok-yin-fung/perl/ch-2.pl b/challenge-246/cheok-yin-fung/perl/ch-2.pl
index 6bb71825bc..06db7aa977 100644
--- a/challenge-246/cheok-yin-fung/perl/ch-2.pl
+++ b/challenge-246/cheok-yin-fung/perl/ch-2.pl
@@ -76,7 +76,7 @@ sub check {
return 0 if $a[3] % $d1 != 0;
$u0 = $u0 *($a[3]/$d1);
$v0 = $v0 *($a[3]/$d1);
- say "$a[3] = $a0*$u0+$b0*$v0";
+ say "$a[3] = $a1*$u0+$b1*$v0";
# for my $j (-10..10) {
# my $x1 = $u0 + $b1/$d1*$j ;
# my $y1 = $v0 - $a1/$d1*$j;
@@ -112,7 +112,7 @@ sub check {
}
}
-use Test::More tests=>10;
+use Test::More tests=>11;
ok check(1, 1, 2, 3, 5);
ok !check(4, 2, 4, 5, 7);
ok check(4, 1, 2, -3, 8);
@@ -126,3 +126,4 @@ ok check(1, 0, 0, 0, 0);
ok check(0, 3, 0, 0, 0);
ok !check(0, 0, 3, 0, 0);
+ok check(2, 4, 8, 16, 32);