diff options
Diffstat (limited to 'internal/casino/cards.go')
| -rw-r--r-- | internal/casino/cards.go | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/internal/casino/cards.go b/internal/casino/cards.go index 0c32e06..f263eb6 100644 --- a/internal/casino/cards.go +++ b/internal/casino/cards.go @@ -1,8 +1,8 @@ package casino import ( - "fmt" "math/rand" + "strconv" ) // card is a single playing card shared by every card-based table game. @@ -21,8 +21,7 @@ func (c card) blackjackValue() int { case "K", "Q", "J": return 10 default: - var value int - fmt.Sscanf(c.rank, "%d", &value) + value, _ := strconv.Atoi(c.rank) return value } } @@ -35,8 +34,7 @@ func (c card) baccaratValue() int { case "A": return 1 default: - var value int - fmt.Sscanf(c.rank, "%d", &value) + value, _ := strconv.Atoi(c.rank) return value } } |
