Compare commits
10 Commits
3d51687b51
...
d743e5610a
| Author | SHA1 | Date | |
|---|---|---|---|
| d743e5610a | |||
| 48f9389100 | |||
| 686e5d6617 | |||
| bdf4c32e70 | |||
| b18f0ae688 | |||
| 9501737b43 | |||
| a6bc671231 | |||
| f9785f0e8a | |||
| a7fc6da2cb | |||
| c2ea96445d |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,3 +1,4 @@
|
|||||||
ledger.db
|
ledger.db
|
||||||
__pycache__/*
|
__pycache__/*
|
||||||
|
src/py/__pycache__/*
|
||||||
*.drawio
|
*.drawio
|
||||||
11
Dockerfile
11
Dockerfile
@@ -1,11 +0,0 @@
|
|||||||
FROM python:3
|
|
||||||
|
|
||||||
RUN pip install discord
|
|
||||||
|
|
||||||
WORKDIR /usr/app/src
|
|
||||||
|
|
||||||
COPY Acronymbot.py ./
|
|
||||||
COPY BlackJack.py ./
|
|
||||||
COPY Ledger.py ./
|
|
||||||
|
|
||||||
CMD [ "python", "./Acronymbot.py" ]
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
import discord
|
|
||||||
import random
|
|
||||||
|
|
||||||
# Temporary List
|
|
||||||
games = ["Left 4 Dead 2",
|
|
||||||
"Aragami",
|
|
||||||
"Astroneer",
|
|
||||||
"Factorio",
|
|
||||||
"Borderlands",
|
|
||||||
"Stardew Valley",
|
|
||||||
"Viscera Cleanup Detail",
|
|
||||||
"SCP",
|
|
||||||
"Satisfactory",
|
|
||||||
"Backrooms (Alternate Ending)",
|
|
||||||
"Ghost Recon Wildlands"
|
|
||||||
]
|
|
||||||
|
|
||||||
def add_game(game: str):
|
|
||||||
games.append(game)
|
|
||||||
|
|
||||||
def pick_game():
|
|
||||||
|
|
||||||
randomIndex = random.randrange(0, len(games))
|
|
||||||
coinFlip = random.randrange(0, 2)
|
|
||||||
if coinFlip:
|
|
||||||
|
|
||||||
return f"Valorant ({games[randomIndex]})"
|
|
||||||
else:
|
|
||||||
|
|
||||||
return games[randomIndex]
|
|
||||||
|
|
||||||
34
Recycle Bin/Gamepicker.py
Normal file
34
Recycle Bin/Gamepicker.py
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
import discord
|
||||||
|
import random
|
||||||
|
|
||||||
|
# Temporary List
|
||||||
|
# games = ["Left 4 Dead 2",
|
||||||
|
# "Aragami",
|
||||||
|
# "Astroneer",
|
||||||
|
# "Factorio",
|
||||||
|
# "Borderlands",
|
||||||
|
# "Stardew Valley",
|
||||||
|
# "Viscera Cleanup Detail",
|
||||||
|
# "SCP",
|
||||||
|
# "Satisfactory",
|
||||||
|
# "Ghost Recon Wildlands"
|
||||||
|
# ]
|
||||||
|
|
||||||
|
games = ["Plate Up",
|
||||||
|
"Terraria",
|
||||||
|
"Ghost Recon"]
|
||||||
|
|
||||||
|
def add_game(game: str):
|
||||||
|
games.append(game)
|
||||||
|
|
||||||
|
def pick_game():
|
||||||
|
|
||||||
|
randomIndex = random.randrange(0, len(games))
|
||||||
|
coinFlip = random.randrange(0, 2)
|
||||||
|
if coinFlip:
|
||||||
|
|
||||||
|
return f"Valorant ({games[randomIndex]})"
|
||||||
|
else:
|
||||||
|
|
||||||
|
return games[randomIndex]
|
||||||
|
|
||||||
20
Recycle Bin/docker-compose.yml
Normal file
20
Recycle Bin/docker-compose.yml
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
version: "3.3"
|
||||||
|
|
||||||
|
networks:
|
||||||
|
net:
|
||||||
|
driver: bridge
|
||||||
|
|
||||||
|
services:
|
||||||
|
acronymbot:
|
||||||
|
build: ./src/py
|
||||||
|
volumes:
|
||||||
|
- "./src/py:/usr/app/src"
|
||||||
|
networks:
|
||||||
|
- "net"
|
||||||
|
depends_on:
|
||||||
|
- database
|
||||||
|
|
||||||
|
database:
|
||||||
|
image: mariadb:latest
|
||||||
|
networks:
|
||||||
|
- "net"
|
||||||
@@ -3,7 +3,7 @@ GAMEINFO:
|
|||||||
ID, NAME, GENRE, GAMEPASS
|
ID, NAME, GENRE, GAMEPASS
|
||||||
|
|
||||||
WHOOWNSIT (bitmap index):
|
WHOOWNSIT (bitmap index):
|
||||||
ID, MARCUS, BENSON, ALEX, TIM
|
ID, MARCUS, BENSON, ALEX, TIM, AIDAN
|
||||||
|
|
||||||
GAMEFACTORS:
|
GAMEFACTORS:
|
||||||
ID, BRAINLEVEL, TIMETOPLAY, CAMPAIGN
|
ID, BRAINLEVEL, TIMETOPLAY, CAMPAIGN
|
||||||
5
Recycle Bin/plan.txt
Normal file
5
Recycle Bin/plan.txt
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
Microservices:
|
||||||
|
- Some sort of database for storing the data
|
||||||
|
- Image for the python code that runs the bot
|
||||||
|
- Something to interface the two, like sparkSQL for interacting with the database
|
||||||
|
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
|
import random
|
||||||
import discord
|
import discord
|
||||||
import sqlite3
|
import sqlite3
|
||||||
from discord import app_commands
|
from discord import app_commands
|
||||||
from BlackJack import BlackJack
|
from BlackJack import BlackJack
|
||||||
from Calculator import Calculator
|
from Calculator import Calculator
|
||||||
from Gamepicker import pick_game
|
|
||||||
|
|
||||||
botIntents = discord.Intents.all()
|
botIntents = discord.Intents.all()
|
||||||
|
|
||||||
@@ -112,16 +112,110 @@ async def calculator(interaction: discord.Interaction):
|
|||||||
calculator = Calculator()
|
calculator = Calculator()
|
||||||
await interaction.followup.send(content="`" + " " * calculator.MAXIMUMBARSIZE + "0`", view=calculator)
|
await interaction.followup.send(content="`" + " " * calculator.MAXIMUMBARSIZE + "0`", view=calculator)
|
||||||
|
|
||||||
|
@tree.command(description="Roll a Dice")
|
||||||
|
@app_commands.choices(dice = [
|
||||||
|
app_commands.Choice(name = 'd4', value=4),
|
||||||
|
app_commands.Choice(name = 'd6', value=6),
|
||||||
|
app_commands.Choice(name = 'd8', value=8),
|
||||||
|
app_commands.Choice(name = 'd10', value=10),
|
||||||
|
app_commands.Choice(name = 'd12', value=12),
|
||||||
|
app_commands.Choice(name = 'd20', value=20),
|
||||||
|
app_commands.Choice(name = 'd100', value=100),
|
||||||
|
])
|
||||||
|
async def roll(interaction: discord.Interaction, dice:app_commands.Choice[int]):
|
||||||
|
|
||||||
|
roll = random.randint(1, dice.value)
|
||||||
|
await interaction.response.send_message(f"{dice.name}: {roll}")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
#### Game Picker ####
|
#### Russian Roulette ####
|
||||||
"""
|
"""
|
||||||
@tree.command(description="Pick a game")
|
MAXLINELENGTH = 12
|
||||||
async def gg(interaction: discord.Interaction):
|
tooLong = lambda x: len(x) > MAXLINELENGTH
|
||||||
|
tooShort = lambda x: len(x) < MAXLINELENGTH
|
||||||
|
difference = lambda x: MAXLINELENGTH - len(x)
|
||||||
|
sidePad = lambda x: " " * (difference(x) // 2)
|
||||||
|
evenPad = lambda x: sidePad(x) + x + sidePad(x)
|
||||||
|
oddPad = lambda x: evenPad(x) + " "
|
||||||
|
|
||||||
game = pick_game()
|
def demon_text_helper(line):
|
||||||
await interaction.response.send_message("Barotrauma")
|
if tooShort(line):
|
||||||
|
if difference(line) % 2 == 0:
|
||||||
|
return evenPad(line)
|
||||||
|
else:
|
||||||
|
return oddPad(line)
|
||||||
|
|
||||||
|
return line
|
||||||
|
|
||||||
|
def demon_text(lineOne="", lineTwo="", lineThree=""):
|
||||||
|
|
||||||
|
if tooLong(lineOne) or tooLong(lineTwo) or tooLong(lineThree):
|
||||||
|
print("Line too long lol")
|
||||||
|
|
||||||
|
lineOne = demon_text_helper(lineOne)
|
||||||
|
lineTwo = demon_text_helper(lineTwo)
|
||||||
|
lineThree = demon_text_helper(lineThree)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
demon = f"``` , , /\ /\ \n\
|
||||||
|
/( /\ )\ _\ \_/ /_ ____________\n\
|
||||||
|
|\_||_/| < \_ _/ > / \ \n\
|
||||||
|
\______/ \|0 0|/ | {lineOne} |\n\
|
||||||
|
_\/_ _(_ ^ _)_ | {lineTwo} |\n\
|
||||||
|
( () ) /`\|V\"\"\"V|/`\ | {lineThree} |\n\
|
||||||
|
{{}} \ \_____/ / <______________/\n\
|
||||||
|
() /\ )=( /\ \n\
|
||||||
|
{{}} / \_/\=/\_/ \ \n```"
|
||||||
|
return demon
|
||||||
|
|
||||||
|
class ShootOrNoShoot(discord.ui.View):
|
||||||
|
def __init__(self, *, timeout=180):
|
||||||
|
super().__init__(timeout=timeout)
|
||||||
|
self.bullets = 6
|
||||||
|
|
||||||
|
@discord.ui.button(label="Shoot", style=discord.ButtonStyle.red)
|
||||||
|
async def shoot(self, interaction: discord.Interaction, button: discord.ui.Button):
|
||||||
|
if self.bullets == 0:
|
||||||
|
for child in self.children:
|
||||||
|
child.disabled = True
|
||||||
|
await interaction.response.edit_message(content=f"What?", view=self)
|
||||||
|
|
||||||
|
if random.randrange(0,self.bullets) == 0:
|
||||||
|
for child in self.children:
|
||||||
|
child.disabled = True
|
||||||
|
|
||||||
|
demonDeath = demon_text(lineOne="You died!", lineTwo="Bahahahah!", lineThree=f"Score: {6 - self.bullets}")
|
||||||
|
await interaction.response.edit_message(content=f"{demonDeath}", view=self)
|
||||||
|
|
||||||
|
else:
|
||||||
|
|
||||||
|
self.bullets -= 1
|
||||||
|
button.label = f"Shoot again"
|
||||||
|
demonLife = demon_text(lineOne="You live", lineTwo="This time!!",
|
||||||
|
lineThree=f"({6 - self.bullets}/5) blanks")
|
||||||
|
await interaction.response.edit_message(content=f"{demonLife}", view=self)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@discord.ui.button(label="PussyOut", style=discord.ButtonStyle.blurple)
|
||||||
|
async def noshoot(self, interaction: discord.Interaction, button: discord.ui.Button):
|
||||||
|
for child in self.children:
|
||||||
|
child.disabled = True
|
||||||
|
|
||||||
|
demonPussy = demon_text(lineOne="You are such", lineTwo="a huge pussy", lineThree= "0 bitches 4u")
|
||||||
|
await interaction.response.edit_message(content=f"{demonPussy}", view=self)
|
||||||
|
|
||||||
|
|
||||||
|
@tree.command(description="????")
|
||||||
|
async def rr(interaction: discord.Interaction):
|
||||||
|
await interaction.response.defer()
|
||||||
|
buttons = ShootOrNoShoot()
|
||||||
|
demon = demon_text(lineTwo="Shoot urself")
|
||||||
|
await interaction.followup.send(content=f"{demon}", view=buttons)
|
||||||
|
|
||||||
"""
|
"""
|
||||||
#### Fin ####
|
#### Fin ####
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
import random
|
import random
|
||||||
from Ledger import Ledger
|
from Ledger import Ledger
|
||||||
|
|
||||||
#TODO Starting a game with 21 fucks with hidden cards
|
|
||||||
#TODO Look into 5card jack thingo that Tim mentioned
|
#TODO Look into 5card jack thingo that Tim mentioned
|
||||||
#TODO Insurance - If dealer starts with 21, you can bet against it and win your money back
|
#TODO Insurance - If dealer starts with 21, you can bet against it and win your money back
|
||||||
#TODO Make each game session more distinct (Embeds?)
|
#TODO Make each game session more distinct (Embeds?)
|
||||||
|
#TODO Card counting.
|
||||||
|
|
||||||
# Game States
|
# Game States
|
||||||
INIT = 0
|
INIT = 0
|
||||||
@@ -29,10 +29,23 @@ class Card():
|
|||||||
self.value = value
|
self.value = value
|
||||||
self.suit = suit
|
self.suit = suit
|
||||||
self.hidden = False
|
self.hidden = False
|
||||||
|
|
||||||
|
if self.value in range(2,7):
|
||||||
|
self.count_value = 1
|
||||||
|
|
||||||
|
elif self.value in range(7,10):
|
||||||
|
self.count_value = 0
|
||||||
|
|
||||||
def turn_card(self):
|
else:
|
||||||
# XOR to flip hidden element
|
self.count_value = -1
|
||||||
self.hidden = self.hidden != True
|
|
||||||
|
|
||||||
|
|
||||||
|
def hide_card(self):
|
||||||
|
self.hidden = True
|
||||||
|
|
||||||
|
def show_card(self):
|
||||||
|
self.hidden = False
|
||||||
|
|
||||||
def get_value(self):
|
def get_value(self):
|
||||||
return self.value
|
return self.value
|
||||||
@@ -51,7 +64,7 @@ class Card():
|
|||||||
strValue = str(self.value)
|
strValue = str(self.value)
|
||||||
|
|
||||||
string = ""
|
string = ""
|
||||||
string = f"{suits[self.suit]}{strValue}"
|
string = f"{suits[self.suit]}{strValue}: ({self.count_value})"
|
||||||
if self.hidden:
|
if self.hidden:
|
||||||
string = "??"
|
string = "??"
|
||||||
return string
|
return string
|
||||||
@@ -67,11 +80,11 @@ class Deck():
|
|||||||
self.discard = []
|
self.discard = []
|
||||||
self.joker = joker
|
self.joker = joker
|
||||||
|
|
||||||
self.deck.extend([Card(x, Card.HEARTS) for x in range(1, 13)])
|
self.deck.extend([Card(x, Card.HEARTS) for x in range(1, 14)])
|
||||||
self.deck.extend([Card(x, Card.DIAMONDS) for x in range(1, 13)])
|
self.deck.extend([Card(x, Card.DIAMONDS) for x in range(1, 14)])
|
||||||
self.deck.extend([Card(x, Card.SPADES) for x in range(1, 13)])
|
self.deck.extend([Card(x, Card.SPADES) for x in range(1, 14)])
|
||||||
self.deck.extend([Card(x, Card.CLUBS) for x in range(1, 13)])
|
self.deck.extend([Card(x, Card.CLUBS) for x in range(1, 14)])
|
||||||
|
print(len(self.deck))
|
||||||
if joker:
|
if joker:
|
||||||
self.deck.append(Card(0, 0))
|
self.deck.append(Card(0, 0))
|
||||||
|
|
||||||
@@ -113,6 +126,7 @@ class Deck():
|
|||||||
class Hand():
|
class Hand():
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
self.hand = []
|
self.hand = []
|
||||||
|
self.hidden_cards = []
|
||||||
|
|
||||||
def sortHand(self):
|
def sortHand(self):
|
||||||
self.hand.sort()
|
self.hand.sort()
|
||||||
@@ -130,11 +144,26 @@ class Hand():
|
|||||||
return self.hand[index]
|
return self.hand[index]
|
||||||
|
|
||||||
def hide_card(self, index):
|
def hide_card(self, index):
|
||||||
self.peek_card(index).turn_card()
|
card = self.peek_card(index)
|
||||||
|
card.hide_card()
|
||||||
|
self.hidden_cards.append(card)
|
||||||
|
|
||||||
|
def show_card(self, index):
|
||||||
|
card = self.peek_card(index)
|
||||||
|
card.show_card()
|
||||||
|
try:
|
||||||
|
self.hidden_cards.remove(card)
|
||||||
|
except ValueError:
|
||||||
|
print("Card not hidden")
|
||||||
|
|
||||||
|
def show_hand(self):
|
||||||
|
extra_count = 0
|
||||||
|
for card in self.hidden_cards:
|
||||||
|
card.show_card()
|
||||||
|
extra_count += card.count_value
|
||||||
|
self.hidden_cards.remove(card)
|
||||||
|
return extra_count
|
||||||
|
|
||||||
def __len__(self):
|
|
||||||
return len(self.hand)
|
|
||||||
|
|
||||||
def __str__(self) -> str:
|
def __str__(self) -> str:
|
||||||
string = ""
|
string = ""
|
||||||
for card in self.hand:
|
for card in self.hand:
|
||||||
@@ -147,11 +176,14 @@ class Hand():
|
|||||||
aces = 0
|
aces = 0
|
||||||
# Add static values
|
# Add static values
|
||||||
for card in self.hand:
|
for card in self.hand:
|
||||||
|
if card.hidden:
|
||||||
|
continue
|
||||||
if card.value == 1:
|
if card.value == 1:
|
||||||
aces += 1
|
aces += 1
|
||||||
continue
|
continue
|
||||||
if card.value > 10:
|
if card.value > 10:
|
||||||
card.value = 10
|
value += 10
|
||||||
|
continue
|
||||||
value += card.value
|
value += card.value
|
||||||
|
|
||||||
# Dynamically add ace value based on ideal rules
|
# Dynamically add ace value based on ideal rules
|
||||||
@@ -174,6 +206,8 @@ class Hand():
|
|||||||
def __next__(self):
|
def __next__(self):
|
||||||
return next(self.iter)
|
return next(self.iter)
|
||||||
|
|
||||||
|
def __len__(self):
|
||||||
|
return len(self.hand)
|
||||||
|
|
||||||
class BlackJack:
|
class BlackJack:
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
@@ -181,34 +215,49 @@ class BlackJack:
|
|||||||
self.playerHand = Hand()
|
self.playerHand = Hand()
|
||||||
self.dealerHand = Hand()
|
self.dealerHand = Hand()
|
||||||
self.ledger = Ledger()
|
self.ledger = Ledger()
|
||||||
|
self.playing = False
|
||||||
|
self.count = 0
|
||||||
|
|
||||||
def deal_card(self, hand):
|
def deal_card(self, hand):
|
||||||
|
card = self.deck.take_from_deck()
|
||||||
|
hand.add_to_hand(card)
|
||||||
|
self.count += card.count_value
|
||||||
|
|
||||||
|
def deal_hidden_card(self, hand):
|
||||||
hand.add_to_hand(self.deck.take_from_deck())
|
hand.add_to_hand(self.deck.take_from_deck())
|
||||||
|
# Hide one of the dealers cards
|
||||||
|
self.dealerHand.hide_card(1)
|
||||||
|
|
||||||
def game_setup(self):
|
def game_setup(self):
|
||||||
# Deal cards in alternate order
|
# Deal cards in alternate order
|
||||||
self.deck.shuffle()
|
self.deck.shuffle()
|
||||||
for _ in range(2):
|
for i in range(2):
|
||||||
self.deal_card(self.playerHand)
|
self.deal_card(self.playerHand)
|
||||||
self.deal_card(self.dealerHand)
|
if i == 0:
|
||||||
|
self.deal_card(self.dealerHand)
|
||||||
|
else:
|
||||||
|
self.deal_hidden_card(self.dealerHand)
|
||||||
|
|
||||||
# Hide one of the dealers cards
|
|
||||||
self.dealerHand.hide_card(1)
|
|
||||||
|
|
||||||
def discard_hand(self, hand):
|
def discard_hand(self, hand):
|
||||||
|
hand.show_hand()
|
||||||
for _ in range(len(hand)):
|
for _ in range(len(hand)):
|
||||||
card = hand.remove_from_hand(0)
|
card = hand.remove_from_hand(0)
|
||||||
self.deck.addToDiscard(card)
|
self.deck.addToDiscard(card)
|
||||||
|
|
||||||
async def show_cards(self, send, displayDealerScore=False):
|
async def show_cards(self, send):
|
||||||
# Show Cards to player
|
# Show Cards to player
|
||||||
string = f"Player Hand = {repr(self.playerHand)}: {self.playerHand}\nDealer Hand = ??: {self.dealerHand}"
|
string = f"Player Hand = {repr(self.playerHand)}: {self.playerHand}\nDealer Hand = {repr(self.dealerHand)}: {self.dealerHand}\nCount = {self.count}"
|
||||||
if displayDealerScore:
|
|
||||||
string = f"Player Hand = {repr(self.playerHand)}: {self.playerHand}\nDealer Hand = {repr(self.dealerHand)}: {self.dealerHand}"
|
|
||||||
|
|
||||||
await send(string)
|
await send(string)
|
||||||
|
|
||||||
async def play_game(self, ID, bet, recv, send):
|
async def play_game(self, ID, bet, recv, send):
|
||||||
|
|
||||||
|
if self.playing:
|
||||||
|
await send("Game in Progress")
|
||||||
|
return
|
||||||
|
else:
|
||||||
|
self.playing = True
|
||||||
gameState = INIT
|
gameState = INIT
|
||||||
|
|
||||||
while gameState != OVER:
|
while gameState != OVER:
|
||||||
@@ -219,6 +268,9 @@ class BlackJack:
|
|||||||
playerStats = self.ledger.read(ID)
|
playerStats = self.ledger.read(ID)
|
||||||
self.game_setup()
|
self.game_setup()
|
||||||
gameState = PLAYERTURN
|
gameState = PLAYERTURN
|
||||||
|
|
||||||
|
if int(repr(self.playerHand)) >= 21:
|
||||||
|
gameState = FINISHED
|
||||||
|
|
||||||
if gameState == PLAYERTURN:
|
if gameState == PLAYERTURN:
|
||||||
|
|
||||||
@@ -227,17 +279,15 @@ class BlackJack:
|
|||||||
if playerHit:
|
if playerHit:
|
||||||
self.deal_card(self.playerHand)
|
self.deal_card(self.playerHand)
|
||||||
else:
|
else:
|
||||||
#TODO Rename hide_card function
|
|
||||||
self.dealerHand.hide_card(1)
|
|
||||||
gameState = DEALERTURN
|
gameState = DEALERTURN
|
||||||
|
|
||||||
if int(repr(self.playerHand)) >= 21:
|
if int(repr(self.playerHand)) >= 21:
|
||||||
|
|
||||||
self.dealerHand.hide_card(1)
|
|
||||||
gameState = FINISHED
|
gameState = FINISHED
|
||||||
|
|
||||||
if gameState == DEALERTURN:
|
if gameState == DEALERTURN:
|
||||||
|
|
||||||
|
extra_count = self.dealerHand.show_hand()
|
||||||
|
self.count += extra_count
|
||||||
if int(repr(self.dealerHand)) > int(repr(self.playerHand)):
|
if int(repr(self.dealerHand)) > int(repr(self.playerHand)):
|
||||||
gameState = FINISHED
|
gameState = FINISHED
|
||||||
continue
|
continue
|
||||||
@@ -256,7 +306,7 @@ class BlackJack:
|
|||||||
tie = False
|
tie = False
|
||||||
playerScore = int(repr(self.playerHand))
|
playerScore = int(repr(self.playerHand))
|
||||||
dealerScore = int(repr(self.dealerHand))
|
dealerScore = int(repr(self.dealerHand))
|
||||||
await self.show_cards(send, True)
|
await self.show_cards(send)
|
||||||
if playerScore == 21:
|
if playerScore == 21:
|
||||||
playerBlackJack = True
|
playerBlackJack = True
|
||||||
if dealerScore == 21:
|
if dealerScore == 21:
|
||||||
@@ -308,8 +358,10 @@ class BlackJack:
|
|||||||
if len(self.deck) < 0.25 * 51:
|
if len(self.deck) < 0.25 * 51:
|
||||||
self.deck.return_all_from_discard()
|
self.deck.return_all_from_discard()
|
||||||
self.deck.shuffle()
|
self.deck.shuffle()
|
||||||
|
self.count = 0
|
||||||
await send("Everyday I'm shuffling")
|
await send("Everyday I'm shuffling")
|
||||||
gameState = OVER
|
gameState = OVER
|
||||||
|
self.playing = False
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
game = BlackJack()
|
game = BlackJack()
|
||||||
@@ -319,6 +371,4 @@ def main():
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
|
||||||
|
|
||||||
11
src/py/Dockerfile
Normal file
11
src/py/Dockerfile
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
FROM python:3
|
||||||
|
|
||||||
|
RUN pip install discord \
|
||||||
|
&& pip install mariadb
|
||||||
|
|
||||||
|
WORKDIR /usr/app/src
|
||||||
|
|
||||||
|
VOLUME /usr/app/src
|
||||||
|
# -v flag to mount to this volume. -v [from]:/usr/app/src
|
||||||
|
|
||||||
|
CMD [ "python", "./Acronymbot.py" ]
|
||||||
BIN
src/py/__pycache__/BlackJack.cpython-310.pyc
Normal file
BIN
src/py/__pycache__/BlackJack.cpython-310.pyc
Normal file
Binary file not shown.
BIN
src/py/__pycache__/Calculator.cpython-310.pyc
Normal file
BIN
src/py/__pycache__/Calculator.cpython-310.pyc
Normal file
Binary file not shown.
BIN
src/py/__pycache__/Gamepicker.cpython-310.pyc
Normal file
BIN
src/py/__pycache__/Gamepicker.cpython-310.pyc
Normal file
Binary file not shown.
BIN
src/py/__pycache__/Ledger.cpython-310.pyc
Normal file
BIN
src/py/__pycache__/Ledger.cpython-310.pyc
Normal file
Binary file not shown.
Reference in New Issue
Block a user