Code And Mathematical Expression Language
CAMEL (Computation And Mathematics Expression Language) is a programming language developed for performing simple mathematical calculations.
When starting to write code in CAMEL, the following declaration is necessary:
@camelCode
CAMEL has two types: “string” and “integer”.
Declare a variable and assign an initial value to it. The value can be an integer or the value of another variable.
let variable_name type = value
Delete the data of a variable.
del type variable_name
Duplicate the data of a variable to another variable.
copy type original_variable_name duplicated_variable_name
Input a value from the keyboard and assign it to a variable. The input value becomes the specified type.
get variable_name type message
Display the value of a variable.
show type variable_name
Perform arithmetic operations on variable_name1 and variable_name2, and assign the result to a specified variable.
+ variable_name1 variable_name2 = result_variable_name
- variable_name1 variable_name2 = result_variable_name
* variable_name1 variable_name2 = result_variable_name
/ variable_name1 variable_name2 = result_variable_name
% variable_name1 variable_name2 = result_variable_name
Output string-type and integer-type variables respectively.
showAll
The argument can be “r”, “w”, or “a”.
“r” is used for reading. The entire file is output.
“w” and “a” can be used for writing. The difference is whether to save completely or save with additional content.
The data to be written to the file is assigned to a variable and then used.
file argument file_name
file argument file_name type variable_name
Lines starting with “!” are commented out. Commented-out lines are not executed.
! comment
If there is an error in the CAMEL program, an error message is displayed.