Conditions
Exact count, comparisons, trait checks, and/not. What is not supported.
Used after when / if / while / until / otherwise when.
Exact count
| Fragment | Parses as |
|---|---|
she has 3 toys | HasExact(she, items, 3) |
she does not have 9 toys | Not(HasExact(…)) |
Comparisons
| Fragment | Parses as | Need to know |
|---|---|---|
she has more than 2 toys | Comparison(GREATER_THAN) | more, bigger, louder, over, above, exceeds + than |
she sniffs less toys than 8 | Comparison(LESS_THAN) | Must use sniffs (or smells, scents, checks, peeks) + less (or fewer, smaller, under, below, quieter) + topic + than + number |
she does not sniff less toys than 8 | Not(Comparison(…)) | Negation works on comparisons |
Not supported in conditions: growls louder than on a field, matches / equals field comparisons, either / or between tests.
Trait checks
| Fragment | Parses as |
|---|---|
my labrador is loud | HasTrait(labrador, loud) |
my labrador is not greedy | Not(HasTrait(…)) |
Note: my labrador is loud in a print line is different (prints true/false). Context matters.
Combining tests
| Fragment | Parses as | Need to know |
|---|---|---|
she has 3 toys and she has more than 2 toys | Logical(AND, …) | Only and joins tests in conditions |
neither my labrador nor my beagle has 9 toys | Logical(NOR, …) | Needs nor between two breed names |
Common mistake
while she toys sniffs less than 8 fails. Write while she sniffs less toys than 8 then. I changed the predicatable word order here so it sounds more like English and not gibberish.
Less-than in loops and branches always needs the sniffs less … than shape for comparisons below exact equality. Greater-than uses has more than.
