Conditionals & Comparisons
if x then y else z
Conditionals
Like most programming languages, Soulver supports conditionals, (also known as "if statements").
In Soulver, a conditional is expressed on a single line:
Declare a variable using a conditional
Using "and" and "or" in conditionals
&& and || are also supported
Comparison operators & booleans
Soulver supports standard "C" style comparison operators. A boolean value (true
or false
) is returned).
Name
Operator
Equal to
==
Not equal to
!=
Greater than
>
Less than
<
Greater than or equal to
>=
Less than or equal to
<=
You may assign a variable a boolean value directly
You can also use comparison operators outside if statements
Last updated