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 details)

Uploaded Source

File details

Details for the file slotmachine-0.0.3.8.tar.gz.

File metadata

  • Download URL: slotmachine-0.0.3.8.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/2.7.14

File hashes

Hashes for slotmachine-0.0.3.8.tar.gz
Algorithm Hash digest
SHA256 c08002cd6e5f844935573552f680b4504d502fc7d9328ad6e298a2205595cc91
MD5 4c8d1d4408c73b58f94b2e0448f1e67d
BLAKE2b-256 45133559836cd2182592a1789622b03bc4d76aa1137ea6d293fa0902a1e5b950

See more details on using hashes here.

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