diff options
| author | E7-87-83 <fungcheokyin@gmail.com> | 2021-06-28 14:21:00 +0800 |
|---|---|---|
| committer | E7-87-83 <fungcheokyin@gmail.com> | 2021-06-28 14:21:00 +0800 |
| commit | 50fc1b3bb6cd9d6260ef876c1c362b0561d5e2f8 (patch) | |
| tree | 14edb28c6d1f6c8b27faa240cebce935af6aff70 | |
| parent | ddb660dac6853e936a9e82213be219fefddee349 (diff) | |
| download | perlweeklychallenge-club-50fc1b3bb6cd9d6260ef876c1c362b0561d5e2f8.tar.gz perlweeklychallenge-club-50fc1b3bb6cd9d6260ef876c1c362b0561d5e2f8.tar.bz2 perlweeklychallenge-club-50fc1b3bb6cd9d6260ef876c1c362b0561d5e2f8.zip | |
something more, something less
| -rw-r--r-- | challenge-118/cheok-yin-fung/awk/ch-1.awk | 4 | ||||
| -rw-r--r-- | challenge-118/cheok-yin-fung/perl/ch-2.pl | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/challenge-118/cheok-yin-fung/awk/ch-1.awk b/challenge-118/cheok-yin-fung/awk/ch-1.awk index fe7e67c04b..18b20df3cf 100644 --- a/challenge-118/cheok-yin-fung/awk/ch-1.awk +++ b/challenge-118/cheok-yin-fung/awk/ch-1.awk @@ -4,8 +4,8 @@ # or: awk -f 'ch-1.awk' < file_contains_an_integer_on_each_line { - n = $0; - i = 0; + n = $0 + i = 0 while (n > 0) { arr[i] = n % 2 n = int(n / 2) diff --git a/challenge-118/cheok-yin-fung/perl/ch-2.pl b/challenge-118/cheok-yin-fung/perl/ch-2.pl index d74f82c92e..3132a7fd82 100644 --- a/challenge-118/cheok-yin-fung/perl/ch-2.pl +++ b/challenge-118/cheok-yin-fung/perl/ch-2.pl @@ -48,9 +48,9 @@ my @min_paths = (); my $dist_tbl = [[0,3,2,3,2,3,4,5], - [3,2,1,2,3,4,3,4], # >[1][1] = 2 only if the target is not a corner - [2,1,4,3,2,3,4,5], - [3,2,3,2,3,4,3,4], + [3,2,1,2,3,4,3,4], # >[1][1] = 2 only if the target + [2,1,4,3,2,3,4,5], # or the departure position + [3,2,3,2,3,4,3,4], # is not a corner [2,3,2,3,4,3,4,5], [3,4,3,4,3,4,5,4], [4,3,4,3,4,5,4,5], |
