taoc1 - aoc22 - advent of code 2022 solutions
 (HTM) git clone git://src.adamsgaard.dk/aoc22
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
       ---
       taoc1 (198B)
       ---
            1 #!/bin/awk -f
            2 # run with ./aoc1.awk <data | sort -n | tail -n 1
            3 
            4 function evalelf() {
            5         printf "%d\telf %d\n", total, ++elf; total=0; getline
            6 }
            7 
            8 /^$/ { evalelf() }
            9 
           10 { total += $1 }
           11 
           12 END{ evalelf() }