Skip to content

Commit

Permalink
Update main.go
Browse files Browse the repository at this point in the history
  • Loading branch information
dreamerminsk authored Jan 17, 2024
1 parent f4e197e commit 95ed11d
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ func GetPlayerStats(value string) *PlayerStats {
return &PlayerStats{Player: player, Centuries: centuries}
}
return nil

}

func ProcessFile(name string) {
Expand All @@ -66,17 +65,15 @@ func ProcessFile(name string) {
for scanner.Scan() {
line := scanner.Text()
if strings.HasPrefix(line, "*") {
if strings.Contains(line, "{{ndash}}") {
parts := strings.Split(line, "{{ndash}}")
centuries := GetCenturies(parts[0])
player := GetPlayer(parts[1])
pss := GetPlayerStats(line)
if pss != nil {
ps = ps + 1
cs = cs + len(centuries)
fmt.Println(player, len(centuries))
for _, century := range centuries {
cs = cs + len(pss.Centuries)
fmt.Println(pss.Player, len(pss.Centuries))
for _, century := range pss.Centuries {
fmt.Println("\t", century)
}
}
}
}
}
fmt.Println("players: ", ps, ", ", "centuries: ", cs)
Expand Down

0 comments on commit 95ed11d

Please sign in to comment.