mirror of
https://github.com/onyx-and-iris/aoc2023.git
synced 2024-11-15 15:10:49 +00:00
move Card struct into one.go
This commit is contained in:
parent
981152aba2
commit
15af19f442
@ -5,6 +5,15 @@ import (
|
|||||||
"unicode"
|
"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
|
// one computes points based on matching numbers
|
||||||
func one(lines []string) (int, error) {
|
func one(lines []string) (int, error) {
|
||||||
f := func(c rune) bool {
|
f := func(c rune) bool {
|
||||||
|
@ -1,14 +1,5 @@
|
|||||||
package main
|
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
|
// two returns the total number of occurrences for all cards
|
||||||
func two(lines []string) (int, error) {
|
func two(lines []string) (int, error) {
|
||||||
var sum = 0
|
var sum = 0
|
||||||
|
Loading…
Reference in New Issue
Block a user