Skip to main content

Simple, expandable, customizable slot machine

Project description

python-slots Build Status

Simple, expandable, customizable slot machine

pip install slotmachine

import slotmachine
slotM = slotmachine.SlotMachine()
print(slotM())
# [['!!!', 'BAR', '(M)']]

slotM = slotmachine.SlotMachine(size=(5,1))
print(slotM())
# [['(H)', '(N)', '!!!', '!!!', '(H)']]

slotM = slotmachine.SlotMachine(jack='BTC', bonus='LTC', size=(5,3))
print(slotM())
# [
#   ['(Z)', '(O)', '(X)', '(M)', '(Z)'],
#   ['(O)', '(Z)', '(H)', 'LTC', 'BTC'],
#   ['(H)', 'LTC', '(O)', '(M)', '(Z)']
# ]

print(slotM.reel)
# ['BTC', '(Z)', '(O)', '(H)', '(X)', '(W)', '(N)', '(M)', 'LTC', '(M)', '(N)', '(W)', '(X)', '(H)', '(O)', '(Z)', 'LTC', '(Z)', '(O)', '(H)', '(X)', '(W)', '(N)', '(M)', 'LTC', '(M)', '(N)', '(W)', '(X)', '(H)', '(O)', '(Z)', 'LTC', '(Z)', '(O)', '(H)', '(X)', '(W)', '(N)', '(M)', 'LTC', '(M)', '(N)', '(W)', '(X)', '(H)', '(O)', '(Z)']

slotM = slotmachine.SlotMachine(size=(5,1))
r = slotM()
print(r)
# [['(X)', '(W)', '(M)', '!!!', '(N)']]
print(slotM.checkLine(r[0]))
# False
r = slotM()
print(r)
# [['BAR', 'BAR', 'BAR', 'BAR', 'BAR']]
print(slotM.checkLine(r[0]))
# 'jackpot'

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

slotmachine-0.0.3.8.tar.gz (3.2 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page