remove scheme ambitions
This commit is contained in:
parent
d83b8aacec
commit
2cf787a203
50
03/main.go
Normal file
50
03/main.go
Normal file
@ -0,0 +1,50 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"fmt"
|
||||
"os"
|
||||
"strconv"
|
||||
"time"
|
||||
)
|
||||
|
||||
func mustAtoi(line string) int {
|
||||
i, _ := strconv.Atoi(line)
|
||||
return i
|
||||
}
|
||||
|
||||
func main() {
|
||||
start := time.Now()
|
||||
partOne()
|
||||
duration := time.Since(start)
|
||||
partTwo()
|
||||
duration2 := time.Since(start)
|
||||
fmt.Printf("p1: %s, p2: %s\n", duration, duration2-duration)
|
||||
}
|
||||
|
||||
func makeScanner(test bool) *bufio.Scanner {
|
||||
var f *os.File
|
||||
if test {
|
||||
f, _ = os.Open("inputs/testinput")
|
||||
} else {
|
||||
f, _ = os.Open("inputs/input")
|
||||
}
|
||||
reader := bufio.NewReader(f)
|
||||
return bufio.NewScanner(reader)
|
||||
}
|
||||
|
||||
func partOne() {
|
||||
scanner := makeScanner(false)
|
||||
|
||||
for scanner.Scan() {
|
||||
// line := scanner.Text()
|
||||
}
|
||||
}
|
||||
|
||||
func partTwo() {
|
||||
scanner := makeScanner(false)
|
||||
|
||||
for scanner.Scan() {
|
||||
// line := scanner.Text()
|
||||
}
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
(import
|
||||
(chicken io)
|
||||
(chicken format)
|
||||
)
|
||||
|
||||
(define print-line
|
||||
(lambda (line)
|
||||
(printf "~A~%" line)))
|
||||
|
||||
(call-with-input-file "inputs/input"
|
||||
(lambda (port)
|
||||
(map
|
||||
print-line
|
||||
(read-lines port))))
|
||||
|
||||
(call-with-input-file "inputs/input"
|
||||
(lambda (port)
|
||||
(map
|
||||
print-line
|
||||
(read-lines port))))
|
3
new.sh
3
new.sh
@ -14,8 +14,5 @@ if [ "${1}" != "" ]; then
|
||||
if [ ! -f "${padded}/main.go" ]; then
|
||||
cp -n main.go.tmpl ${padded}/main.go
|
||||
fi
|
||||
# if [ ! -f "${padded}/main.scm" ]; then
|
||||
# cp -n main.scm.tmpl ${padded}/main.scm
|
||||
# fi
|
||||
echo "https://adventofcode.com/${__year}/day/${1}"
|
||||
fi
|
||||
|
@ -1,5 +1,7 @@
|
||||
# AOC 2023
|
||||
|
||||
In Chicken Scheme? Perhaps. Go as a fallback.
|
||||
~~In Chicken Scheme? Perhaps.~~Like I actually have time to learn Scheme's idioms with a six-month-old in the house.
|
||||
|
||||
Go as a fallback.
|
||||
|
||||
<https://adventofcode.com/2023/>
|
||||
|
Loading…
Reference in New Issue
Block a user