Changed recursion limit to 10,000 (was 200)

This commit is contained in:
2023-06-06 21:02:01 +10:00
parent cf6db57787
commit bb81b8c474
4 changed files with 35 additions and 5 deletions

View File

@@ -1,4 +0,0 @@
var s = "42";
var t = "69";
print int (s + t) - 1;

17
scripts/test_sum.js Normal file
View File

@@ -0,0 +1,17 @@
//the test case (js)
function test_sum(key, val) {
function sum(n) {
if (n < 2) {
return n;
}
return n + sum(n - 1);
}
const result = sum(val);
console.log(`${key}: ${result}`);
}
for (let i = 0; i <= 10; i++) {
test_sum(i, i * 1000);
}

17
scripts/test_sum.toy Normal file
View File

@@ -0,0 +1,17 @@
//the test case (toy)
fn test_sum(key: int, val: int) {
fn sum(n: int) {
if (n < 2) {
return n;
}
return n + sum(n - 1);
}
var result: int const = sum(val);
print string key + ": " + string result;
}
for (var i: int = 0; i <= 10; i++) {
test_sum(i, i * 1000);
}