simplified code and fixed a bug

This commit is contained in:
cozis
2022-03-12 22:47:23 +01:00
parent e120b1e8af
commit 1374e05579
7 changed files with 379 additions and 390 deletions
+6 -8
View File
@@ -1,20 +1,18 @@
A = 'Hello';
B = ', ';
C = 'world';
D = strcat(A, B, C);
fun append_esclamation_mark(A, n)
{
fun append_esclamation_mark(A, n) {
if n == none:
n = 1;
i = 0;
while i < n:
{
A = strcat(A, '!');
i = i + 1;
}
while i < n: {
A = strcat(A, '!');
i = i + 1;
}
return A;
}