Fixed control ofdealer bug

This commit is contained in:
2023-06-12 17:29:25 +10:00
parent 6e80036ba7
commit b2dad99f6c
5 changed files with 20 additions and 3 deletions

View File

@@ -118,7 +118,7 @@ async def calculator(interaction: discord.Interaction):
#### Game Picker ####
"""
@tree.command(description="Pick a game")
async def gimmegame(interaction: discord.Interaction):
async def gg(interaction: discord.Interaction):
game = pick_game()
await interaction.response.send_message(game)

View File

@@ -164,11 +164,12 @@ class BlackJack:
async def play_game(self, ID, bet, recv, send):
self.gameState = INIT
while self.gameState != OVER:
if self.gameState == INIT:
gameOver = False
playerStats = self.ledger.read(ID)
if playerStats is None:
self.ledger.write(ID)
@@ -176,6 +177,7 @@ class BlackJack:
self.deal()
play = None
self.playerTurn = True
playerStood = False
dealerStood = False
validInput = False

View File

@@ -18,7 +18,6 @@ games = ["Left 4 Dead 2",
def add_game(game: str):
games.append(game)
def pick_game():
randomIndex = random.randrange(0, len(games))
@@ -29,3 +28,19 @@ def pick_game():
else:
return games[randomIndex]
I = 1000000000
i = I
zeros = 0
ones = 0
while i > 0:
number = random.randrange(0, 2)
if number:
ones += 1
else:
zeros += 1
i -= 1
percentZeros = zeros/I
print(percentZeros)

BIN
ledger.db

Binary file not shown.