Skip to content

patrickschaffrath/aoc2018

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aoc2018

Parsing of inputs:

Use

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

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

Day1

sed ':a;N;$!ba;s/\n/,\n\x20\x20/g;s/\+//g;s/^/input =\n\x20\x20\[/;s/$/\]/' > /dev/clipboard

Day2

sed -E ':a;N;$!ba;s/([[:lower:]])/\x27\1\x27,/g;s/,\n/\],\n\x20\x20\[/g;s/^/input =\n\x20\x20\[\[/;s/,$/\]\]/' > /dev/clipboard

Day3

sed -E ':a;N;$!ba;s/\n/,\n\x20\x20/g;s/\#[0-9]+\x20\x40\x20/\(\(/g;s/\:/\),/g;s/\x20([0-9]+)x([0-9]+)/\(\1,\2\)\)/g;s/^/input =\n\x20\x20\[/;s/$/\]/' > /dev/clipboard

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published