; return 1 if next three greater than first three (func is-increasing (inp) (if (< (apply + (most inp)) (apply + (rest inp))) 1 0)) ; this works, but i don't like redefining variables (func iter-list (inp) (def acc 0) (for-count (- (length inp) 3) (redef acc (+ acc (is-increasing (slice inp _idx_ 4))))) acc) (def lines (map string->int (map strip (read-lines "input.txt")))) (print (->string (iter-list lines)))