Skip to content

patrickschaffrath/aoc2019

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

aoc2019

Parsing of inputs:

Use

curl -sb session=<token> https://adventofcode.com/2019/day/<day>/input

with valid <token> and <day>, then pipe with sed command of the day.

Day1

sed ':a;N;$!ba;s/\n/\x20/g;s/^/\(define input \x27\(/;s/$/\)\)/'

Day2

sed 's/\x2C/\x20/g;s/^/\(define input \x27\(/;s/$/\)\)/'

Day3

sed -r ':a;N;$!ba;s/([U,D,L,R])([0-9]+)/\(\#\\\1 \2\)/g;s/\x2C/\x20/g;s/(.*)\n(.*)/\(define wire-one \x27\(\1\)\)\n\n\(define wire-two \x27\(\2\)\)/'

Day4

sed 's/\x2D/\x20/;s/^/\(define input \x27\(/;s/$/\)\)/'

Day5

sed 's/\x2C/\x20/g;s/^/\(define input \x27\(/;s/$/\)\)/'

Day6

sed -r ':a;N;$!ba;s/(.{3})[)](.{3})/\(\x22\1\x22 \x22\2\x22\)/g;s/\n/\x20/g;s/^/\(define input \x27\(/;s/$/\)\)/'

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages