Removed one bug, many to go

This commit is contained in:
Davide Oddone 2023-12-08 00:39:40 +01:00
parent be248b81a0
commit 31cc223170

View File

@ -113,10 +113,10 @@ func ThreeOrTwo(cards string) int {
for i := range mapSeeds { for i := range mapSeeds {
// If an element has 3 values, we have a three of a kind // If an element has 3 values, we have a three of a kind
if m[i] == 3 { if m[i] == 3 {
return 4 return 3
/// If an element has 2 values, we have a two pair /// If an element has 2 values, we have a two pair
} else if m[i] == 2 { } else if m[i] == 2 {
return 3 return 2
} }
} }
return -1 return -1
@ -233,7 +233,7 @@ func main() {
var wg sync.WaitGroup var wg sync.WaitGroup
wg.Add(len(lines)) wg.Add(len(lines))
for i := 0; i < len(lines); i++ { for i := 0; i < len(lines); i++ {
go g.DetermineType(cards[i], i, &wg) g.DetermineType(cards[i], i, &wg)
} }
wg.Wait() wg.Wait()
@ -251,7 +251,7 @@ func main() {
g.baseThirteen[i] = make([]int, len(g.typeOfHand[i])) g.baseThirteen[i] = make([]int, len(g.typeOfHand[i]))
// For every element in a single type of hand // For every element in a single type of hand
for j := range g.typeOfHand[i] { for j := range g.typeOfHand[i] {
go g.ChangeBase(i, j, &wg) g.ChangeBase(i, j, &wg)
} }
} }
wg.Wait() wg.Wait()