adventofcode/helpers.go
Brian Buller bb174c5f5b Day 4 Complete
Removed solutions from 'problem' files
Added 'helpers' file with functions that I commonly use in these
solutions.
2016-12-04 09:55:02 -06:00

31 lines
433 B
Go

package aoc
import (
"bufio"
"log"
"os"
"strconv"
)
func stdinToStringSlice() []string {
var input []string
scanner := bufio.NewScanner(os.Stdin)
for scanner.Scan() {
input = append(input, scanner.Text())
}
return input
}
func itoa(i int) string {
return strconv.Itoa(i)
}
func atoi(i string) int {
var ret int
var err error
if ret, err = strconv.Atoi(i); err != nil {
log.Fatal("Invalid Atoi")
}
return ret
}