Skip to content
This repository was archived by the owner on Apr 23, 2025. It is now read-only.

Commit 3511a05

Browse files
committed
tweak constant names
1 parent 64bb0fe commit 3511a05

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Gym/Blackjack/main.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,17 @@ class Solver {
4444
var alpha: Float = 0.5
4545
let gamma: Float = 0.2
4646

47-
let numPlayerStates = 32 // 21 + 10 + 1 offset
48-
let numDealerVisibleStates = 11 // 10 + 1 offset
49-
let numAceStates = 2 // useable / not bool
50-
let numPlayerActions = 2 // hit / stay
47+
let playerStateCount = 32 // 21 + 10 + 1 offset
48+
let dealerVisibleStateCount = 11 // 10 + 1 offset
49+
let aceStateCount = 2 // useable / not bool
50+
let playerActionCount = 2 // hit / stay
5151

5252
init() {
5353
Q = Array(repeating: Array(repeating: Array(repeating: Array(repeating: 0.0,
54-
count: numPlayerActions),
55-
count: numAceStates),
56-
count: numDealerVisibleStates),
57-
count: numPlayerStates)
54+
count: playerActionCount),
55+
count: aceStateCount),
56+
count: dealerVisibleStateCount),
57+
count: playerStateCount)
5858
}
5959

6060
func updateQLearningStrategy(prior: BlackjackState,

0 commit comments

Comments
 (0)