You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
528 B
Plaintext
39 lines
528 B
Plaintext
PartI ← (
|
|
▽×⊃(≤@9|≥@0|∘) # digits only
|
|
parse⊟⊃(⊢|⊢⇌) # add them together
|
|
)
|
|
|
|
PartII ← (
|
|
.
|
|
⊐≡⌕⊙¤ {"one" "two" "three"
|
|
"four" "five" "six"
|
|
"seven" "eight" "nine"}
|
|
/+≡×+1⇡9
|
|
≡((⋅∘|+@0⊙;)>0.)
|
|
PartI
|
|
)
|
|
|
|
$ 1abc2
|
|
$ pqr3stu8vwx
|
|
$ a1b2c3d4e5f
|
|
$ treb7uchet
|
|
|
|
⊜PartI≠@\n.
|
|
/+
|
|
|
|
$ two1nine
|
|
$ eightwothree
|
|
$ abcone2threexyz
|
|
$ xtwone3four
|
|
$ 4nineeightseven2
|
|
$ zoneight234
|
|
$ 7pqrstsixteen
|
|
|
|
⊜PartII≠@\n.
|
|
/+
|
|
|
|
&fras "day01.in"
|
|
|
|
⊜(⊟⊃(PartI|PartII))≠@\n.
|
|
/+
|