Skip to content

Instantly share code, notes, and snippets.

@zgunz42
Created November 20, 2021 14:09
Show Gist options
  • Save zgunz42/c64d59181b868ccd65d7d9fa33c6d38a to your computer and use it in GitHub Desktop.
Save zgunz42/c64d59181b868ccd65d7d9fa33c6d38a to your computer and use it in GitHub Desktop.
package main
import "fmt"
func main() {
var lastResult string
var sum int
fmt.Scanln(&lastResult)
results := []string{"w", "l", "w", "d", "w", "l", "l", "l", "d", "d", "w", "l", "w", "d"}
for _, val := range append(results, lastResult) {
switch val {
case "w":
sum += 3
case "d":
sum += 1
case "l":
continue
}
}
fmt.Println(sum)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment