Recursive function helper
ASPL 0.7.0 · Current release
Compute factorial recursively with no output and process status 120 in browser and native execution.
On this page
Purpose and preparation
Browser and native, ASPL 0.7.0. No input lines, data assets or source modules are required. The factorial example returns process status 120 with no output. A shell treats that nonzero status as unsuccessful even though language execution succeeds.
Arabic source
Open a new browser draft, then select Run explicitly. Opening checks without executing.
Execution: Browser and native · ASPL 0.7.0
- No prior knowledge is required to open and check it.
Input: No input lines are required.
دالة مضروب(القيمة: ص64) -> ص64 {
إذا القيمة <= 1 {
أرجع 1.
}
أرجع القيمة * مضروب(القيمة - 1).
}
دالة ابدأ_الرئيسية() -> ص64 {
أرجع مضروب(5).
}
Expected outcomes
{
"browser": {
"check": "success",
"class": "success",
"output": "",
"processStatus": 120
},
"native": {
"check": 0,
"status": 120,
"output": ""
}
}English source
Open a new browser draft, then select Run explicitly. Opening checks without executing.
Execution: Browser and native · ASPL 0.7.0
- No prior knowledge is required to open and check it.
Input: No input lines are required.
fn factorial(value: i64) -> i64 {
if value <= 1 {
return 1;
}
return value * factorial(value - 1);
}
fn start_main() -> i64 {
return factorial(5);
}
Expected outcomes
{
"browser": {
"check": "success",
"class": "success",
"output": "",
"processStatus": 120
},
"native": {
"check": 0,
"status": 120,
"output": ""
}
}Check the result
Source cards show exact catalog outcomes. Downloads retain original bytes, digests and supplied vocabulary.