diff options
| author | Paulo Custodio <pauloscustodio@gmail.com> | 2021-03-16 00:07:12 +0000 |
|---|---|---|
| committer | Paulo Custodio <pauloscustodio@gmail.com> | 2021-03-16 00:07:12 +0000 |
| commit | 642034051ba6c835543a1d3219aeee370aef096f (patch) | |
| tree | 2cafac31283481c6a704d7a23f9bfe5eacec79f2 | |
| parent | fc6564872bbc5d8558fda016a6907fbe0cbac619 (diff) | |
| download | perlweeklychallenge-club-642034051ba6c835543a1d3219aeee370aef096f.tar.gz perlweeklychallenge-club-642034051ba6c835543a1d3219aeee370aef096f.tar.bz2 perlweeklychallenge-club-642034051ba6c835543a1d3219aeee370aef096f.zip | |
Remove tabs
| -rw-r--r-- | challenge-093/paulo-custodio/lua/ch-1.lua | 8 | ||||
| -rw-r--r-- | challenge-093/paulo-custodio/lua/ch-2.lua | 10 | ||||
| -rw-r--r-- | challenge-093/paulo-custodio/python/ch-1.py | 2 | ||||
| -rw-r--r-- | challenge-093/paulo-custodio/t/test-2.yaml | 4 | ||||
| -rw-r--r-- | challenge-103/paulo-custodio/perl/ch-1.pl | 2 |
5 files changed, 13 insertions, 13 deletions
diff --git a/challenge-093/paulo-custodio/lua/ch-1.lua b/challenge-093/paulo-custodio/lua/ch-1.lua index b55104f074..e844b64283 100644 --- a/challenge-093/paulo-custodio/lua/ch-1.lua +++ b/challenge-093/paulo-custodio/lua/ch-1.lua @@ -7,7 +7,7 @@ TASK #1 > Max Points Submitted by: Mohammad S Anwar You are given set of co-ordinates @N. -Write a script to count maximum points on a straight line when given +Write a script to count maximum points on a straight line when given co-ordinates plotted on 2-d plane. Example 1: @@ -41,7 +41,7 @@ function get_points() local x = tonumber(arg[i]) local y = tonumber(arg[i+1]) table.insert(P, {x,y}) - end + end return P end @@ -54,7 +54,7 @@ function in_line(pi, pj, pk) dyl = pj[2] - pi[2]; cross = dxc * dyl - dyc * dxl; - + return cross == 0 and true or false end @@ -73,7 +73,7 @@ function max_in_line(P) max_count = math.max(max_count, count) end end - + return max_count end diff --git a/challenge-093/paulo-custodio/lua/ch-2.lua b/challenge-093/paulo-custodio/lua/ch-2.lua index 047f1462eb..1b0170ae9e 100644 --- a/challenge-093/paulo-custodio/lua/ch-2.lua +++ b/challenge-093/paulo-custodio/lua/ch-2.lua @@ -54,15 +54,15 @@ end function parse_subtree(lines, row, col) local tree = {} tree.value = tonumber(ch(lines,row,col)) - + if ch(lines, row + 1, col - 1) == '/' then tree.left = parse_subtree(lines, row + 2, col - 2) end - + if ch(lines, row + 1, col + 1) == '\\' then tree.right = parse_subtree(lines, row + 2, col + 2) end - + return tree end @@ -75,7 +75,7 @@ end -- return the subtree path len function add_subtree_paths(node, cur_len, total_len) cur_len = cur_len + node.value - if node.left then + if node.left then total_len = add_subtree_paths(node.left, cur_len, total_len) end if node.right then @@ -84,7 +84,7 @@ function add_subtree_paths(node, cur_len, total_len) if not node.left and not node.right then total_len = total_len + cur_len end - + return total_len end diff --git a/challenge-093/paulo-custodio/python/ch-1.py b/challenge-093/paulo-custodio/python/ch-1.py index 72ad9f00f7..35cecbb3cc 100644 --- a/challenge-093/paulo-custodio/python/ch-1.py +++ b/challenge-093/paulo-custodio/python/ch-1.py @@ -6,7 +6,7 @@ # Submitted by: Mohammad S Anwar # You are given set of co-ordinates @N. # -# Write a script to count maximum points on a straight line when given +# Write a script to count maximum points on a straight line when given # co-ordinates plotted on 2-d plane. # # Example 1: diff --git a/challenge-093/paulo-custodio/t/test-2.yaml b/challenge-093/paulo-custodio/t/test-2.yaml index fdfe423b93..015f03e5cf 100644 --- a/challenge-093/paulo-custodio/t/test-2.yaml +++ b/challenge-093/paulo-custodio/t/test-2.yaml @@ -1,6 +1,6 @@ - setup: cleanup: - args: + args: input: | | 1 | / @@ -10,7 +10,7 @@ output: 13 - setup: cleanup: - args: + args: input: | | 1 | / \ diff --git a/challenge-103/paulo-custodio/perl/ch-1.pl b/challenge-103/paulo-custodio/perl/ch-1.pl index afb70678de..3a3b3c5432 100644 --- a/challenge-103/paulo-custodio/perl/ch-1.pl +++ b/challenge-103/paulo-custodio/perl/ch-1.pl @@ -24,7 +24,7 @@ use strict; use warnings; use 5.030; -my @animals = qw(Rat Ox Tiger Rabbit Dragon Snake Horse Goat Monkey Rooster Dog Pig); +my @animals = qw(Rat Ox Tiger Rabbit Dragon Snake Horse Goat Monkey Rooster Dog Pig); my @elements = qw(Wood Wood Fire Fire Earth Earth Metal Metal Water Water); my($year) = @ARGV; |
