madness continues

This commit is contained in:
2025-03-28 13:04:53 +00:00
parent 23e0208317
commit cabc283673
12 changed files with 156 additions and 25 deletions

View File

@@ -7,6 +7,7 @@ func BuildBallsSlice(t models.Ticket) []int {
if t.GameType == "Lotto" && t.Ball6 > 0 {
balls = append(balls, t.Ball6)
}
return balls
}
@@ -18,5 +19,6 @@ func BuildBonusSlice(t models.Ticket) []int {
if t.Bonus2 != nil {
bonuses = append(bonuses, *t.Bonus2)
}
return bonuses
}

16
helpers/match.go Normal file
View File

@@ -0,0 +1,16 @@
package helpers
func CountMatches(a, b []int) int {
m := make(map[int]bool)
for _, n := range b {
m[n] = true
}
match := 0
for _, n := range a {
if m[n] {
match++
}
}
return match
}

View File

@@ -69,5 +69,6 @@ func InSlice(n int, list []int) bool {
return true
}
}
return false
return true
}