Greeting with line input
ASPL 0.7.0 · Current release
Complete source and a checked ASPL 0.7.0 outcome.
On this page
Purpose and outcome
Print a prompt, read a name, then print a greeting and return 0. Send the declared input line for the chosen variant. EOF before the line traps with input-exhausted and retains the printed prompt.
See Line input.
Arabic source
This is a supplied complete source. Opening creates a new draft; Run requires an explicit action.
Execution: Browser and native · ASPL 0.7.0
- No prior knowledge is required to open and check it.
Input lines: ["ليلى"]
دالة ابدأ_الرئيسية() -> ص64 {
اطبع("ما اسمك؟ ").
دع الاسم = اقرأ_سطر().
اطبع("مرحبا ").
اطبع(الاسم).
اطبع("\س").
أرجع 0.
}
Expected outcomes
{
"browser": {
"check": "success",
"class": "success",
"output": "ما اسمك؟ مرحبا ليلى\n",
"processStatus": 0
},
"native": {
"check": 0,
"status": 0,
"output": "ما اسمك؟ مرحبا ليلى\n"
}
}English source
This is a supplied complete source. Opening creates a new draft; Run requires an explicit action.
Execution: Browser and native · ASPL 0.7.0
- No prior knowledge is required to open and check it.
Input lines: ["Mina"]
fn start_main() -> i64 {
print("ما اسمك؟ ");
let name = read_line();
print("مرحبا ");
print(name);
print("\n");
return 0;
}
Expected outcomes
{
"browser": {
"check": "success",
"class": "success",
"output": "ما اسمك؟ مرحبا Mina\n",
"processStatus": 0
},
"native": {
"check": 0,
"status": 0,
"output": "ما اسمك؟ مرحبا Mina\n"
}
}Mixed source
This is a supplied complete source. Opening creates a new draft; Run requires an explicit action.
Execution: Browser and native · ASPL 0.7.0
- No prior knowledge is required to open and check it.
Input lines: ["١٢٣","١٢٣"]
fn مرر(value: string) -> string {
return value;
}
fn start_main() -> i64 {
print("first: ");
var first = اقرأ_سطر();
let kept = first.
let returned = مرر(first).
اطبع("second: ").
let second = read_line().
first = second.
إذا returned matches kept {
print("equal: ");
print(returned).
اطبع(" / ").
print(kept).
اطبع("\n").
return 0.
}
أرجع 1.
}
Expected outcomes
{
"browser": {
"check": "success",
"class": "success",
"output": "first: second: equal: ١٢٣ / ١٢٣\n",
"processStatus": 0
},
"native": {
"check": 0,
"status": 0,
"output": "first: second: equal: ١٢٣ / ١٢٣\n"
}
}Check the result
The source card shows hosts, input, and expected outcomes from the canonical catalog. Reading language changes neither source nor result.