Compare commits

..

3 commits

3 changed files with 16 additions and 1 deletions

View file

@ -2,3 +2,6 @@
This repo contains the result of a masochistic chemical engineer.
https://adventofcode.com/
### License
This repository is licensed under the MIT license unless otherwise specified.

View file

@ -19,3 +19,11 @@ Part 2 is written in Go and can only be ran on Linux, so it counts.
#### Part 2:
0. (Optional) Compile `d4p2.go`
1. Run the program specifying the input as the first command line argument. `go run d4p2.go input` or `./d4p2 input`
### FAQ:
#### 1. Spreadsheets aren't a programming language!!!!!!!!!!!!!!!!!!
That's not a question.
#### 2. Aren't you cheating by not using a non-programming language such as a spreadsheet?
Don't care.
(Besides, it was harder this way)

View file

@ -1,4 +1,3 @@
// +build linux
package main
import (
@ -8,6 +7,7 @@ import (
"os"
"strings"
"regexp"
"runtime"
)
func find_num_wins(winners string, numbers string) int {
@ -24,6 +24,10 @@ func find_num_wins(winners string, numbers string) int {
func main() {
if runtime.GOOS != "linux" {
panic("This is for Linux only.")
}
if len(os.Args) < 2 {
panic("You did not specify an input file.")
}