aboutsummaryrefslogtreecommitdiff
path: root/internal/casino/cards.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-08-07 05:02:39 -0400
committerhistoria <[not public]>2026-08-07 05:02:39 -0400
commit9a716a7d2ce514f452b425caedc1a9a15cde09f0 (patch)
treede980f16c4af93512a1616e6521275fd62aca542 /internal/casino/cards.go
parent0f008790f192a491ac3901d54b506b756f57fef8 (diff)
downloadthehouseoficarus-9a716a7d2ce514f452b425caedc1a9a15cde09f0.tar.gz
feat: disconnect forfeits bet and frees up seat
Diffstat (limited to 'internal/casino/cards.go')
-rw-r--r--internal/casino/cards.go8
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
}
}