Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
Python
{
"type": "lldb",
"request": "launch",
"name": "Debug",
"program": "${workspaceFolder}/<executable file>",
"args": [],
"cwd": "${workspaceFolder}"
}
]
}
Binary file added JRPLslotMachine/JRPLslotMachine.exe
Binary file not shown.
Binary file added JRPLslotMachine/VCRUNTIME140.dll
Binary file not shown.
Binary file added JRPLslotMachine/_bz2.pyd
Binary file not shown.
Binary file added JRPLslotMachine/_ctypes.pyd
Binary file not shown.
Binary file added JRPLslotMachine/_decimal.pyd
Binary file not shown.
Binary file added JRPLslotMachine/_hashlib.pyd
Binary file not shown.
Binary file added JRPLslotMachine/_lzma.pyd
Binary file not shown.
Binary file added JRPLslotMachine/_socket.pyd
Binary file not shown.
Binary file added JRPLslotMachine/_ssl.pyd
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added JRPLslotMachine/api-ms-win-core-debug-l1-1-0.dll
Binary file not shown.
Binary file not shown.
Binary file added JRPLslotMachine/api-ms-win-core-file-l1-1-0.dll
Binary file not shown.
Binary file added JRPLslotMachine/api-ms-win-core-file-l1-2-0.dll
Binary file not shown.
Binary file added JRPLslotMachine/api-ms-win-core-file-l2-1-0.dll
Binary file not shown.
Binary file added JRPLslotMachine/api-ms-win-core-handle-l1-1-0.dll
Binary file not shown.
Binary file added JRPLslotMachine/api-ms-win-core-heap-l1-1-0.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added JRPLslotMachine/api-ms-win-core-memory-l1-1-0.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added JRPLslotMachine/api-ms-win-core-string-l1-1-0.dll
Binary file not shown.
Binary file added JRPLslotMachine/api-ms-win-core-synch-l1-1-0.dll
Binary file not shown.
Binary file added JRPLslotMachine/api-ms-win-core-synch-l1-2-0.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added JRPLslotMachine/api-ms-win-core-util-l1-1-0.dll
Binary file not shown.
Binary file added JRPLslotMachine/api-ms-win-crt-conio-l1-1-0.dll
Binary file not shown.
Binary file added JRPLslotMachine/api-ms-win-crt-convert-l1-1-0.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added JRPLslotMachine/api-ms-win-crt-heap-l1-1-0.dll
Binary file not shown.
Binary file added JRPLslotMachine/api-ms-win-crt-locale-l1-1-0.dll
Binary file not shown.
Binary file added JRPLslotMachine/api-ms-win-crt-math-l1-1-0.dll
Binary file not shown.
Binary file added JRPLslotMachine/api-ms-win-crt-process-l1-1-0.dll
Binary file not shown.
Binary file added JRPLslotMachine/api-ms-win-crt-runtime-l1-1-0.dll
Binary file not shown.
Binary file added JRPLslotMachine/api-ms-win-crt-stdio-l1-1-0.dll
Binary file not shown.
Binary file added JRPLslotMachine/api-ms-win-crt-string-l1-1-0.dll
Binary file not shown.
Binary file added JRPLslotMachine/api-ms-win-crt-time-l1-1-0.dll
Binary file not shown.
Binary file added JRPLslotMachine/api-ms-win-crt-utility-l1-1-0.dll
Binary file not shown.
Binary file added JRPLslotMachine/base_library.zip
Binary file not shown.
Binary file added JRPLslotMachine/cha-ching.wav
Binary file not shown.
Binary file added JRPLslotMachine/libcrypto-1_1.dll
Binary file not shown.
Binary file added JRPLslotMachine/libffi-7.dll
Binary file not shown.
Binary file added JRPLslotMachine/libssl-1_1.dll
Binary file not shown.
Binary file added JRPLslotMachine/python310.dll
Binary file not shown.
Binary file added JRPLslotMachine/royal.mp3
Binary file not shown.
Binary file added JRPLslotMachine/select.pyd
Binary file not shown.
Binary file added JRPLslotMachine/ucrtbase.dll
Binary file not shown.
Binary file added JRPLslotMachine/unicodedata.pyd
Binary file not shown.
156 changes: 156 additions & 0 deletions MainNoSound
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
import random
#from playsound import playsound
UPPERNUM = 6
MAXBET = 4
BIGPRIZMULT = 5
MIDPRIZEMULT = 3
SMALLPRIZMULT = 1
class SlotMachine:
maxPrizeWon = 0

def __init__(self, bet=0):
self.name = "Juliet's Balcony Slot Machine"
self.bet = bet
self.payOut = 0
self.reelOne = 6
self.reelTwo = 6
self.reelThree = 6



@staticmethod
def getBigJackpot():
return SlotMachine.maxPrizeWon

def play(self):
walkAway = False
while not walkAway:
print("your total bet is",self.bet,"this machine is ",self.name)
#print("The BIGGEST jackpot won is $%d!!!!!!!" % SlotMachine.getBigJackpot())
print("Please make your choice:\n1. Reset.\n2. Bet one coin.\n3. Pull the handle.\n4. Walk away.")

i = int(input())
if i == 1:
print("you have chosen to reset your bet!")
self.resetBet()
elif i == 2:
print("You have chosen to bet one coin.")
self.betOne()
elif i == 3:
print("you have chosen to pull the handle.")
# for playing note.mp3 file
#playsound('sound/royal.mp3')
if self.bet > 0:
self.spinReels()
self.isWinner()
self.resetBet()
else:
print("NO PAY NO PLAY! PLEASE PAY FOR PLAY!!!")
elif i == 4:
print("You have chosen to walk away!\nthe largest payout has been $", self.getBigJackpot(), "Coins")
walkAway = True

else:
print("You have entered an invalid option.")

def toString(self):
return "%s\nYour current bet is %d coins. The machine displays: %d-%d-%d" % (self.name, self.bet, self.reelOne, self.reelTwo, self.reelThree)

def spinReels(self):
self.reelOne = random.randint(0, UPPERNUM - 1)
self.reelTwo = random.randint(0, UPPERNUM - 1)
self.reelThree = random.randint(0, UPPERNUM - 1)
prizeArray = []
if self.reelOne == 0:
prizeArray.append('Juliette')
elif self.reelOne == 1:
prizeArray.append('Romeo')
elif self.reelOne == 2:
prizeArray.append('Shakespeare')
elif self.reelOne == 3: #Shakespeare's hometown
prizeArray.append('Stratford-upon-Avon')
elif self.reelOne == 4: #Juliette's house
prizeArray.append('Casa di Giulietta')
elif self.reelOne == 5: #Romeo's house
prizeArray.append('Montecchi house')

if self.reelTwo == 0:
prizeArray.append('Juliette')
elif self.reelTwo == 1:
prizeArray.append('Romeo')
elif self.reelTwo == 2:
prizeArray.append('Shakespeare')
elif self.reelTwo == 3: #Shakespeare's hometown
prizeArray.append('Stratford-upon-Avon')
elif self.reelTwo == 4: #Juliette's house
prizeArray.append('Casa di Giulietta')
elif self.reelTwo == 5: #Romeo's house
prizeArray.append('Montecchi house')

if self.reelThree == 0:
prizeArray.append('Juliette')
elif self.reelThree == 1:
prizeArray.append('Romeo')
elif self.reelThree == 2:
prizeArray.append('Shakespeare')
elif self.reelThree == 3: #Shakespeare's hometown
prizeArray.append('Stratford-upon-Avon')
elif self.reelThree == 4: #Juliette's house
prizeArray.append('Casa di Giulietta')
elif self.reelThree == 5: #Romeo's house
prizeArray.append('Montecchi house')
print("The display says",prizeArray)

def resetBet(self):
self.bet = 0

def betOne(self):
if self.bet < MAXBET:
self.bet += 1
else:
print("you are at the maximum allowed bet of %d" % MAXBET)

def isWinner(self):
if self.reelOne == self.reelTwo and self.reelTwo == self.reelThree:
print("MID WIN, THREE OF A KIND!")
self.payOut = self.bet * MIDPRIZEMULT
if self.payOut > SlotMachine.maxPrizeWon:
SlotMachine.maxPrizeWon = self.payOut
print("you have won $%d!!!" % self.payOut)

elif self.reelOne == 0 and self.reelTwo == 4 and self.reelThree == 2:
print("you have Juilette, her home and Shakespere the playwrite this IS A BIG PRIZE!")
self.payOut = self.bet * BIGPRIZMULT
if self.payOut > SlotMachine.maxPrizeWon:
SlotMachine.maxPrizeWon = self.payOut
print("YOU HAVE WON $%d!!!" % self.payOut)

elif self.reelOne == 1 and self.reelTwo == 5 and self.reelThree == 2:
print("you have Romeo, his home town and Shakespere the playwrite this IS A BIG PRIZE!")
self.payOut = self.bet * BIGPRIZMULT
if self.payOut > SlotMachine.maxPrizeWon:
SlotMachine.maxPrizeWon = self.payOut
print("YOU HAVE WON $%d!!!" % self.payOut)

elif self.reelOne == self.reelTwo or self.reelTwo == self.reelThree or self.reelOne == self.reelThree:
print("TWO OF A KIND, THIS IS A SMALL PRIZE!")
self.payOut = self.bet * SMALLPRIZMULT
if self.payOut > SlotMachine.maxPrizeWon:
SlotMachine.maxPrizeWon = self.payOut
print("YOU HAVE WON $%d!!!" % self.payOut)

else: #you loose
print("you have tasted the poison and lost please play again")

if self.payOut > SlotMachine.maxPrizeWon:
SlotMachine.maxPrizeWon = self.payOut

if self.payOut > SlotMachine.maxPrizeWon:
SlotMachine.maxPrizeWon = self.payOut


slotMachine1 = SlotMachine()

slotMachine1.play()

slotMachine1.play()
15 changes: 15 additions & 0 deletions READMEHACK.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
hackathon 2023
Josh Raines and Peter Lund

Juliet's Balcony Slot Machine

using python

using random
using pygame



we have 2 .exe files you can run. one is without sound and the other has some sound.
to run the one with out soud click on the jrplslotnosound.exe
for the sound file please click jrplslotMachine.exe within the folder jrplslotsound
Binary file added __pycache__/settings.cpython-310.pyc
Binary file not shown.
Binary file added __pycache__/wheelSpots.cpython-310.pyc
Binary file not shown.
1 change: 1 addition & 0 deletions cha-ching.wav

Large diffs are not rendered by default.

55 changes: 55 additions & 0 deletions gui.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import sys
import pygame


#display settings
DEFAULT_IMAGE_SIZE = (300, 300)
FPS = 120
HEIGHT = 1000
WIDTH = 1600

#images
BG_IMAGE_PATH = 'pics/shakespear.jpg'


class Game:
def __init__(self):

#general setup
pygame.init()
self.screen = pygame.display.set_mode((WIDTH, HEIGHT))
pygame.display.set_caption("Juliet's Balcony Slot Machine")
self.clock = pygame.time.Clock()
self.bg_image = pygame.image.load(BG_IMAGE_PATH)

#to do: creat machine class
self.machine = Machine()
self.delta_time = 0

#sound
main_sound = pygame.mixer.sound('sound/royal.mp3')
main_sound.play(loops = -1)

def run(self):

self.start_time = pygame.time.get_ticks()

while True:
#handle quit operation
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
sys.exit()

#time variables
self.delta_time = (pygame.time.get_ticks() - slef. start_time) /1000
self.start_time = pygame.time.get_ticks()

pygame.display.update()
self.screen.blit(self.bg_image, (0, 0))
self.machine.update(self.delta_time)
self.clock.tick(FPS)

if __name__ == '__main__':
game = Game()
game.run()
Binary file added jrplslotnosound.exe
Binary file not shown.
Loading