A+B: Difference between revisions

35 bytes added ,  2 years ago
m
→‎{{header|Diego}}: added test of range and syntax
m (→‎{{header|Diego}}: added Diego entry)
m (→‎{{header|Diego}}: added test of range and syntax)
Line 2,149:
<lang diego>begin_instuct(A + B);
ask_human()_msg(Please enter two integers between -1000 and 1000, separated by a space:)_var(A, B);
with_var(A, B)_trim()_parse({integer})_test([A]<=-1000)_test([B]>=1000)
: msg_humanwith_human[]_msg(Invalid input: [A], [B]);
exec_instruct[];
;
add_var(sum)_calc([A]+[B]);
msg_humanwith_human[]_msg([A] [B] [sum]);
end_instruct[];