build_visitor fixed, going to test it

This commit is contained in:
ProgramSnail 2023-04-25 21:21:36 +03:00
parent 5bf0c1bf48
commit c34523bd4f
23 changed files with 45468 additions and 45273 deletions

View file

@ -1,15 +1,15 @@
def fruit_cost : fruit = {
return (match fruit with
| $Banana -> 11
| $Apple | $Orange -> 7)
return (match fruit with
| $Banana -> 11
| $Apple | $Orange -> 7)
}
def amount_to_string : x is_zero_separated = {
const ans = match x with
| 0 ? is_zero_separated -> "Zero"
| 0 | 1 | 2 | 3 | 4 -> "Few"
| x ? (5..9).contains x -> "Several"
| x ? (10..19).contains x -> "Pack"
| _ -> "Lots"
const ans = match x with
| 0 ? is_zero_separated () -> "Zero"
| 0 | 1 | 2 | 3 | 4 -> "Few"
| x ? (5..9).contains x -> "Several"
| x ? (10..19).contains x -> "Pack"
| _ -> "Lots"
return ans
}