Backup commit before crunch

This commit is contained in:
2023-05-16 18:32:25 +01:00
parent 33413b2b0f
commit 126494c63f
59 changed files with 847 additions and 236 deletions

View File

@@ -0,0 +1,20 @@
import std::(parse_float, to_string)
import std::(readline, print)
export main := do{
cps data = readline;
let a = parse_float data;
cps op = readline;
cps print ("\"" ++ op ++ "\"\n");
cps data = readline;
let b = parse_float data;
let result = (
if op == "+" then a + b
else if op == "-" then a - b
else if op == "*" then a * b
else if op == "/" then a / b
else "Unsupported operation" -- dynamically typed shenanigans
);
cps print (to_string result ++ "\n");
0
}