From f7a59653480ae2500a916ca4b62924b5adc33498 Mon Sep 17 00:00:00 2001 From: Dreaded_X Date: Thu, 9 Dec 2021 01:24:50 +0100 Subject: [PATCH] Added script to quickly set-up for the new challenge --- new.sh | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100755 new.sh diff --git a/new.sh b/new.sh new file mode 100755 index 0000000..76438a6 --- /dev/null +++ b/new.sh @@ -0,0 +1,39 @@ +#!/bin/bash +mkdir -p $1/$2 +cd $1/$2 +cat > go.mod << EOM +module AoC/$1/$2 + +require AoC/$1/common v0.0.0 + +require github.com/joho/godotenv v1.4.0 // indirect + +replace AoC/$1/common v0.0.0 => ../common + +go 1.17 +EOM + +go get AoC/$1/common@v0.0.0 + +cat > main.go << EOM +package main + +import ( + aoc "AoC/2021/common" + "bufio" +) + +func main() { + challenge := aoc.New($1, $2) + + challenge.Test(\`\`, []int{-1, -1}) + + challenge.Solution(1, func (input *bufio.Scanner) int { + return 0 + }) + + challenge.Solution(2, func (input *bufio.Scanner) int { + return 0 + }) +} +EOM