pre-recording backup

This commit is contained in:
2023-05-17 03:49:26 +01:00
parent 126494c63f
commit 330ddbe399
29 changed files with 404 additions and 195 deletions

View File

@@ -2,10 +2,13 @@ import std::(parse_float, to_string)
import std::(readline, print)
export main := do{
cps print "left operand: ";
cps data = readline;
let a = parse_float data;
cps print "operator: ";
cps op = readline;
cps print ("\"" ++ op ++ "\"\n");
cps print ("you selected \"" ++ op ++ "\"\n");
cps print "right operand: ";
cps data = readline;
let b = parse_float data;
let result = (
@@ -13,8 +16,8 @@ export main := do{
else if op == "-" then a - b
else if op == "*" then a * b
else if op == "/" then a / b
else "Unsupported operation" -- dynamically typed shenanigans
else (panic "Unsupported operation")
);
cps print (to_string result ++ "\n");
cps print ("Result: " ++ to_string result ++ "\n");
0
}