USING: io.encodings.utf8 splitting math.parser sequences ; IN: aoc1 : input ( -- contents ) "/tmp/aoc1.txt" utf8 file-contents ; : greatest-calories ( contents -- n ) "\n" split [ empty? ] split-when [ [ dec> ] map sum ] map supremum ; : main ( -- n ) input greatest-calories ;