Skip to content

Suma (Comparisons) ​

Suma is an if-statement of Zigurate used to do comparisons and execute specific functions depending on the condition in execution time.

Syntax ​

js
suma true {
    // code if is true
} li {
    // code if is false
}

Relational Operators ​

OperatorDescriptionFor
isUsed to verify equalitystring, int, float, bool
is_notUsed to verify inequalitystring, int, float, bool
is_moreIf is more thanint, float
is_lessIf is less thanint, float
is_more_eqIf is more or equal toint, float
is_less_eqIf is less or equal toint, float

Logical Operators ​

OperatorDescription
a and bIf the two conditions (a e b) is true, execute.
a or bIf any of the conditions (a e b) is true, execute.

Example ​

With type boolean:

js
uda is_active = true

suma is_active is true {
    silim("It's active!")
} li {
    silim("It's not active!")
}

With type string:

js
uda name = "gilgamesh"

suma name is "uruk" {
    silim("It's Uruk")
} li {
    silim("It's not Uruk!")
}

With type integer:

js
uda a = 10

suma a is_more 10 {
    silim("Correct!")
} li {
    silim("Incorrect!")
}

With type floating:

js
uda a = 2.5

suma a is_less_eq 5.5 {
    silim("Correct!")
} li {
    silim("Incorrect!")
}

Comparing with uda as value's reference:

js
uda target = 100
uda current = 50

suma current is_more_eq target {
    silim("Completed!")
} li {
    silim("Incompleted!")
}