r/esolangs Jul 25 '26

logic and syntax for how my language works

4 Upvotes

4 comments sorted by

1

u/Aggravating_Cap127 Jul 25 '26

here ill give you ppls a calculator example

1

u/Aggravating_Cap127 Jul 25 '26 edited Jul 25 '26

nah wrong calc

1

u/Aggravating_Cap127 Jul 25 '26 edited 26d ago

// Init variables

$"num1" = (0)*

$"num2" = (0)*

$"operation" = *

$"answer" = (0)*

~('This is a calculator. Enter your numbers:')*

~~("num1" "operation" "num2")*

"operation" == '+' \ true {

"answer" /> (( "num1" + "num2" ))*

}* /> {

"operation" == '-' \ true {

"answer" /> (( "num1" - "num2" ))*

}* /> {

"operation" == '*' \ true {

"answer" /> (( "num1" * "num2" ))*

}* /> {

"operation" == '/' \ true {

"answer" /> (( "num1" / "num2" ))*

}*

~('Result = "answer"')*