Paste: AoC 2021 1-1

Author: nomennescio
Mode: factor
Date: Sat, 4 Dec 2021 08:13:13
Plain Text |
! 2021 nomennescio
USING: kernel io io.files io.encodings.utf8 math math.parser math.vectors prettyprint sequences ;
IN: aoc2021

: file-numbers ( path encoding -- numbers ) file-lines [ string>number ] map ;
: deltas ( numbers -- deltas ) [ 0 suffix ] [ 0 prefix ] bi v- rest ;
: #increases ( numbers -- n ) deltas [ 0 > ] count ;
: 1-1 ( -- ) "input.1-1.txt" utf8 file-numbers #increases . ; 

MAIN: 1-1

New Annotation

Summary:
Author:
Mode:
Body: