aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaulo Custodio <pauloscustodio@gmail.com>2021-07-06 21:42:21 +0100
committerPaulo Custodio <pauloscustodio@gmail.com>2021-07-06 21:42:21 +0100
commit7e18a5b7b098b8448f40e2694a60bfbda53cfd3b (patch)
treee1779aaddf5b046e0381a30063e73309209480cd
parent5aca4db735e55e7b8cfb535a0edc2b9874e368c0 (diff)
downloadperlweeklychallenge-club-7e18a5b7b098b8448f40e2694a60bfbda53cfd3b.tar.gz
perlweeklychallenge-club-7e18a5b7b098b8448f40e2694a60bfbda53cfd3b.tar.bz2
perlweeklychallenge-club-7e18a5b7b098b8448f40e2694a60bfbda53cfd3b.zip
Remove unnecessary trim(str(n))
-rw-r--r--challenge-001/paulo-custodio/basic/ch-1.bas2
-rw-r--r--challenge-001/paulo-custodio/basic/ch-2.bas2
-rw-r--r--challenge-002/paulo-custodio/basic/ch-2.bas2
-rw-r--r--challenge-003/paulo-custodio/basic/ch-1.bas2
-rw-r--r--challenge-003/paulo-custodio/basic/ch-2.bas2
-rw-r--r--challenge-092/paulo-custodio/basic/ch-1.bas2
-rw-r--r--challenge-096/paulo-custodio/basic/ch-2.bas2
-rw-r--r--challenge-097/paulo-custodio/basic/ch-2.bas2
-rw-r--r--challenge-098/paulo-custodio/basic/ch-2.bas2
-rw-r--r--challenge-099/paulo-custodio/basic/ch-2.bas2
-rw-r--r--challenge-100/paulo-custodio/basic/ch-2.bas2
-rw-r--r--challenge-101/paulo-custodio/basic/ch-2.bas2
-rw-r--r--challenge-102/paulo-custodio/basic/ch-1.bas2
-rw-r--r--challenge-104/paulo-custodio/basic/ch-1.bas2
-rw-r--r--challenge-105/paulo-custodio/basic/ch-1.bas2
-rw-r--r--challenge-119/paulo-custodio/basic/ch-1.bas2
-rw-r--r--challenge-119/paulo-custodio/basic/ch-2.bas2
17 files changed, 17 insertions, 17 deletions
diff --git a/challenge-001/paulo-custodio/basic/ch-1.bas b/challenge-001/paulo-custodio/basic/ch-1.bas
index e0411bbbc0..83ce3236c3 100644
--- a/challenge-001/paulo-custodio/basic/ch-1.bas
+++ b/challenge-001/paulo-custodio/basic/ch-1.bas
@@ -30,4 +30,4 @@ end function
dim text as string
text = join_args()
-print trim(str(replace_e(text)));" ";text
+print replace_e(text);" ";text
diff --git a/challenge-001/paulo-custodio/basic/ch-2.bas b/challenge-001/paulo-custodio/basic/ch-2.bas
index fa98c88d09..52bec3c42a 100644
--- a/challenge-001/paulo-custodio/basic/ch-2.bas
+++ b/challenge-001/paulo-custodio/basic/ch-2.bas
@@ -16,6 +16,6 @@ for i=1 to val(command(1))
elseif i mod 5=0 then
print "buzz"
else
- print trim(str(i))
+ print i
end if
next i
diff --git a/challenge-002/paulo-custodio/basic/ch-2.bas b/challenge-002/paulo-custodio/basic/ch-2.bas
index e6849fb776..090979f9a4 100644
--- a/challenge-002/paulo-custodio/basic/ch-2.bas
+++ b/challenge-002/paulo-custodio/basic/ch-2.bas
@@ -63,7 +63,7 @@ end function
' main
if command(1) = "-r" then
- print trim(str(scan_number(command(2), 35)))
+ print scan_number(command(2), 35)
else
print format_number(val(command(1)), 35)
end if
diff --git a/challenge-003/paulo-custodio/basic/ch-1.bas b/challenge-003/paulo-custodio/basic/ch-1.bas
index 83b3973361..560c747d2c 100644
--- a/challenge-003/paulo-custodio/basic/ch-1.bas
+++ b/challenge-003/paulo-custodio/basic/ch-1.bas
@@ -144,5 +144,5 @@ end function
' main
dim i as integer
for i=1 to val(command(1))
- print trim(str(next_hamming()))
+ print next_hamming()
next i
diff --git a/challenge-003/paulo-custodio/basic/ch-2.bas b/challenge-003/paulo-custodio/basic/ch-2.bas
index 5987ed7ee5..e2e14cece5 100644
--- a/challenge-003/paulo-custodio/basic/ch-2.bas
+++ b/challenge-003/paulo-custodio/basic/ch-2.bas
@@ -14,7 +14,7 @@ sub draw_pascal(rows as integer)
for row=1 to rows
' print current row
print space(rows-row);
- for col=0 to row-1: print trim(str(n(cur,col)));" ";: next col: print
+ for col=0 to row-1: print n(cur,col);" ";: next col: print
' compute next row
n(1-cur, 0) = 1: n(1-cur,row) = 1
diff --git a/challenge-092/paulo-custodio/basic/ch-1.bas b/challenge-092/paulo-custodio/basic/ch-1.bas
index bfaafba85f..ac8e0a0c39 100644
--- a/challenge-092/paulo-custodio/basic/ch-1.bas
+++ b/challenge-092/paulo-custodio/basic/ch-1.bas
@@ -44,4 +44,4 @@ function isomorphic(a as string, b as string) as integer
isomorphic = 1
end function
-print trim(str(isomorphic(command(1), command(2))))
+print isomorphic(command(1), command(2))
diff --git a/challenge-096/paulo-custodio/basic/ch-2.bas b/challenge-096/paulo-custodio/basic/ch-2.bas
index ff29be1017..529364dabd 100644
--- a/challenge-096/paulo-custodio/basic/ch-2.bas
+++ b/challenge-096/paulo-custodio/basic/ch-2.bas
@@ -69,4 +69,4 @@ function wag_fish_dist(a as string, b as string) as integer
wag_fish_dist = d(len(a), len(b))
end function
-print trim(str(wag_fish_dist(command(1), command(2))))
+print wag_fish_dist(command(1), command(2))
diff --git a/challenge-097/paulo-custodio/basic/ch-2.bas b/challenge-097/paulo-custodio/basic/ch-2.bas
index fa6bcfbdf9..4c3a50d602 100644
--- a/challenge-097/paulo-custodio/basic/ch-2.bas
+++ b/challenge-097/paulo-custodio/basic/ch-2.bas
@@ -43,4 +43,4 @@ function bit_flips(bits as string, n as integer) as integer
bit_flips=flips
end function
-print trim(str(bit_flips(command(1), val(command(2)))))
+print bit_flips(command(1), val(command(2)))
diff --git a/challenge-098/paulo-custodio/basic/ch-2.bas b/challenge-098/paulo-custodio/basic/ch-2.bas
index 4cc8a5717d..61d820b75f 100644
--- a/challenge-098/paulo-custodio/basic/ch-2.bas
+++ b/challenge-098/paulo-custodio/basic/ch-2.bas
@@ -85,5 +85,5 @@ do while command(i)<>""
i=i+1
loop
-print trim(str(search_insert(aN(), n)))
+print search_insert(aN(), n)
print_numbers aN()
diff --git a/challenge-099/paulo-custodio/basic/ch-2.bas b/challenge-099/paulo-custodio/basic/ch-2.bas
index 68365a805d..562e1fdec1 100644
--- a/challenge-099/paulo-custodio/basic/ch-2.bas
+++ b/challenge-099/paulo-custodio/basic/ch-2.bas
@@ -45,4 +45,4 @@ function count_subsequences(s as string, t as string) as integer
end function
' main
-print trim(str(count_subsequences(command(1), command(2))))
+print count_subsequences(command(1), command(2))
diff --git a/challenge-100/paulo-custodio/basic/ch-2.bas b/challenge-100/paulo-custodio/basic/ch-2.bas
index 407b0f24ea..ba622bef5d 100644
--- a/challenge-100/paulo-custodio/basic/ch-2.bas
+++ b/challenge-100/paulo-custodio/basic/ch-2.bas
@@ -90,4 +90,4 @@ do while command(i) <> ""
add_row(i, command(i))
i = i + 1
loop
-print trim(str(min_sum()))
+print min_sum()
diff --git a/challenge-101/paulo-custodio/basic/ch-2.bas b/challenge-101/paulo-custodio/basic/ch-2.bas
index 68b0ad627b..9ab4cb5710 100644
--- a/challenge-101/paulo-custodio/basic/ch-2.bas
+++ b/challenge-101/paulo-custodio/basic/ch-2.bas
@@ -46,4 +46,4 @@ for i=1 to 3
next
P0.x = 0.0
P0.y = 0.0
-print trim(str(point_in_triangle(P0, P(1), P(2), P(3))))
+print point_in_triangle(P0, P(1), P(2), P(3))
diff --git a/challenge-102/paulo-custodio/basic/ch-1.bas b/challenge-102/paulo-custodio/basic/ch-1.bas
index 161682f7a8..3f13b6226d 100644
--- a/challenge-102/paulo-custodio/basic/ch-1.bas
+++ b/challenge-102/paulo-custodio/basic/ch-1.bas
@@ -42,7 +42,7 @@ sub print_rare_numbers(n as Integer)
if is_perfect_square(r+r1) then
if r>=r1 then
if is_perfect_square(r-r1) then
- print trim(str(r))
+ print r
end if
end if
end if
diff --git a/challenge-104/paulo-custodio/basic/ch-1.bas b/challenge-104/paulo-custodio/basic/ch-1.bas
index d9b758a281..52675c2fba 100644
--- a/challenge-104/paulo-custodio/basic/ch-1.bas
+++ b/challenge-104/paulo-custodio/basic/ch-1.bas
@@ -28,6 +28,6 @@ end function
dim i as integer, n as integer
n=val(command(1))
for i=0 to n-1
- print trim(str(fusc(i)));" ";
+ print fusc(i);" ";
next
print
diff --git a/challenge-105/paulo-custodio/basic/ch-1.bas b/challenge-105/paulo-custodio/basic/ch-1.bas
index 790f9314b9..ddf50f0d6d 100644
--- a/challenge-105/paulo-custodio/basic/ch-1.bas
+++ b/challenge-105/paulo-custodio/basic/ch-1.bas
@@ -24,4 +24,4 @@ dim n as integer, k as integer
n=val(command(1))
k=val(command(2))
-print trim(str(round(k^(1/n))))
+print round(k^(1/n))
diff --git a/challenge-119/paulo-custodio/basic/ch-1.bas b/challenge-119/paulo-custodio/basic/ch-1.bas
index bacfeddcac..f93c21d499 100644
--- a/challenge-119/paulo-custodio/basic/ch-1.bas
+++ b/challenge-119/paulo-custodio/basic/ch-1.bas
@@ -27,4 +27,4 @@
dim n as integer
n = val(command(1))
n = ((int(n / 16) mod 16) + ((n mod 16) * 16))
-print trim(str(n))
+print n
diff --git a/challenge-119/paulo-custodio/basic/ch-2.bas b/challenge-119/paulo-custodio/basic/ch-2.bas
index 9b761f6b94..ae3836bbaf 100644
--- a/challenge-119/paulo-custodio/basic/ch-2.bas
+++ b/challenge-119/paulo-custodio/basic/ch-2.bas
@@ -47,4 +47,4 @@ end sub
dim num as integer, i as integer
num = val(command(1))
for i=1 to num: next_seq: next i
-print trim(str(n))
+print n