Organization + Task 1 objectives t#30

This commit is contained in:
Scarlett
2025-02-24 15:28:46 -05:00
parent c1191c888e
commit 44ddfa41f8
23 changed files with 40 additions and 64 deletions

View File

@ -0,0 +1,26 @@
(* Type definitions *)
type string: 1 -> character
type int2int: integer -> integer
type string2int: string -> integer
(* Function prototypes
They use the above type definitions
*)
function square : int2int
function entry : string2int
(* Function definition
Functions must be declared before they are defined
*)
square(x) := {
return x * x;
}
(* Function definition
entry is the first function called
*)
entry(arg) := {
input = 7;
expected = 49;
actual := square(input);
rseult := expected = actual;
return 0;
[ integer: input; integer: expected; integer: actual; boolean: result; string: input ]
}