finally add real logical operators

This commit is contained in:
2025-12-26 11:52:23 +01:00
parent 270386da95
commit db2e639cc8
16 changed files with 96 additions and 49 deletions

View File

@@ -2,13 +2,13 @@ func check[report: array] : bool
let increasing: bool = array.nth(report, 0) < array.nth(report, 1)
for i in 0..array.size(report)-1
if array.nth(report, i) > array.nth(report, i + 1) & increasing
if array.nth(report, i) > array.nth(report, i + 1) && increasing
return false
if array.nth(report, i) < array.nth(report, i + 1) & !increasing
if array.nth(report, i) < array.nth(report, i + 1) && !increasing
return false
let diff: i64 = math.abs(array.nth(report, i) - array.nth(report, i + 1))
if diff < 1 | diff > 3
if diff < 1 || diff > 3
return false
return true