From 50fc1b3bb6cd9d6260ef876c1c362b0561d5e2f8 Mon Sep 17 00:00:00 2001 From: E7-87-83 Date: Mon, 28 Jun 2021 14:21:00 +0800 Subject: something more, something less --- challenge-118/cheok-yin-fung/awk/ch-1.awk | 4 ++-- 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], -- cgit