move Card struct into one.go

This commit is contained in:
onyx-and-iris 2023-12-04 19:41:29 +00:00
parent 981152aba2
commit 15af19f442
2 changed files with 9 additions and 9 deletions

View File

@ -5,6 +5,15 @@ import (
"unicode"
)
// Card represents a single card.
// it tracks its number of matches and occurrences
type Card struct {
matches int
occurrences int
}
var cards = []Card{}
// one computes points based on matching numbers
func one(lines []string) (int, error) {
f := func(c rune) bool {

View File

@ -1,14 +1,5 @@
package main
// Cards represents a single card.
// it tracks its matching numbers and occurrences
type Card struct {
matches int
occurrences int
}
var cards = []Card{}
// two returns the total number of occurrences for all cards
func two(lines []string) (int, error) {
var sum = 0