Skip to content
forked from echojc/aocutil

Fetch input data for Advent of Code challenges.

Notifications You must be signed in to change notification settings

dalizard/aocutil

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Import the inputs for Advent of Code challenges straight into your code.

Fetched data is cached by default.

Usage

  1. Log into Advent of Code from your browser.
  2. Find your session cookie and save the value to a file (e.g. session_id).
  3. Init a reader and get your input:
i, err := aocutil.NewInputFromFile("session_id")
if err != nil {
  log.Fatal(err)
}

lines, err := i.Strings(2018, 2)
if err != nil {
  log.Fatal(err)
}

// use lines

Types

func (i *Input) BigFloats(year, day int) ([]*big.Float, error)
func (i *Input) BigInts(year, day int, base int) ([]*big.Int, error)
func (i *Input) Bytes(year, day int) ([]byte, error)
func (i *Input) Floats(year, day int) ([]float64, error)
func (i *Input) Int64s(year, day int, base int) ([]int64, error)
func (i *Input) Ints(year, day int) ([]int, error)
func (i *Input) Reader(year, day int) (io.ReadCloser, error)
func (i *Input) Strings(year, day int) ([]string, error)

See godoc for more info.

About

Fetch input data for Advent of Code challenges.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%