18,700
edits
m (wording improvements) |
m (more wording) |
||
Line 241: | Line 241: | ||
|} | |} | ||
Note that "=" is '''not''' for checking if one entity is equal to another (see "eq" | Note that "=" is '''not''' for checking if one entity is equal to another (see "eq" under {{SectionLink||Relational}} for that). | ||
===Arithmetical=== | ===Arithmetical=== | ||
Line 282: | Line 282: | ||
} | } | ||
Alternatively | Alternatively you can use the sum operator, which doesn't suffer from this issue: | ||
if (5+-6 eq -1) | if (5+-6 eq -1) | ||
Line 303: | Line 303: | ||
| eq | | eq | ||
| Equal to | | Equal to | ||
| Tests if two values are equal. | | Tests if two values are equal. | ||
|- | |- | ||
| ne | | ne | ||
| Not equal to | | Not equal to | ||
| Tests if two values are different. | | Tests if two values are different. | ||
|- | |- | ||
| > | | > | ||
Line 336: | Line 336: | ||
| ! | | ! | ||
| Not | | Not | ||
| Logical Not. Reverses the result of a test | | Logical Not. Reverses the result of a test. | ||
|- | |- | ||
| and | | and | ||
Line 347: | Line 347: | ||
|} | |} | ||
See {{SectionLink||if}} | To elaborate on the purpose of '!' meaning "not", the following three lines are equivalent: | ||
!(some_bool eq true) | |||
some_bool eq false | |||
some_bool ne true | |||
See {{SectionLink||if}} for detailed examples of using the logical operators. | |||
==Reserved words== | ==Reserved words== | ||
Line 358: | Line 363: | ||
'''var''' int a = 0; | '''var''' int a = 0; | ||
After this, you | After this, you refer to the variable merely as "a". See {{SectionLink||Variables}} for details on declaring variables. | ||
====func==== | ====func==== | ||
Line 366: | Line 371: | ||
} | } | ||
After this, you call the function merely by writing its name; "spawn_team" would work, but the proper new-style syntax is "spawn_team();". See {{SectionLink||Functions}} for details on declaring functions. | |||
===Type specification=== | ===Type specification=== |