aoc2023/day-5/data.go
2024-01-01 11:32:43 +00:00

23 lines
377 B
Go

package main
type data struct {
dest int
source int
offset int
}
func newData(nums ...int) data {
return data{dest: nums[0], source: nums[1], offset: nums[2]}
}
func (d data) transform(start, end int) (int, int) {
f := func(x int) int {
return x - d.source + d.dest
}
return f(start), f(end - 1)
}
var dataMap = map[string][]data{}
var identifiers = []string{}