This commit is contained in:
Ingy döt Net 2013-10-27 22:24:23 +00:00
parent 6f050a029e
commit 776bba907c
3887 changed files with 59894 additions and 7280 deletions

View file

@ -1,14 +1,17 @@
#define std'basic'*.
#define math'* = std'math'*.
#define system.
#define extensions'io.
#define extensions'math.
#symbol Program =
// --- Program ---
#symbol program =
[
#var a := 'program'input >> Integer.
#var b := 'program'input >> Integer.
#var a := consoleEx readLine:(Integer new).
#var b := consoleEx readLine:(Integer new).
'program'output << a << " + " << b << " = " << a + b << "%n".
'program'output << a << " - " << b << " = " << a - b << "%n".
'program'output << a << " * " << b << " = " << a * b << "%n".
'program'output << a << " / " << b << " = " << a / b << "%n". // truncates towards 0
'program'output << a << " %% " << b << " = " << a~math'eops math'modulus:b << "%n". // matches sign of first operand
consoleEx << a << " + " << b << " = " << a + b << "%n".
consoleEx << a << " - " << b << " = " << a - b << "%n".
consoleEx << a << " * " << b << " = " << a * b << "%n".
consoleEx << a << " / " << b << " = " << a / b << "%n". // truncates towards 0
consoleEx << a << " %% " << b << " = " << (modulus:a:b) << "%n". // matches sign of first operand
].