Skip to content

Terminal slot machine in pure Python with volatility presets, wilds/bonus logic, selectable paylines, autospin, gamble feature, and persistent session stats.

License

Notifications You must be signed in to change notification settings

YashviShahh/python-slot-machine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Python Slot Machine (Terminal)

A 3Γ—3 terminal slot machine written in pure Python β€” no external dependencies.

✨ Features

  • Volatility presets: low, med, high (changes reel weights)
  • Wilds (W) substitute and 2Γ— the line payout when present
  • Bonus (*): 3 anywhere triggers 3 free spins @ 2Γ—, with retrigger (+1 spin)
  • Selectable paylines: 3 / 5 / 8 (rows, +diagonals, +verticals)
  • Gamble double-or-nothing feature on wins
  • Autospin and persistent profile (slot_profile.json) with lifetime stats
  • Clean ASCII board with subtle ANSI colors (works in most terminals)

πŸš€ Run

python Python_Slot_Machine_Pro.py

Controls

  • s = single spin
  • a = autospin (choose spin count)
  • d = deposit
  • t = show payout table
  • q = quit

You’ll also choose volatility and paylines (3/5/8), then bet per line (1–100).

🧠 Notes

  • Session is saved to slot_profile.json automatically on exit.
  • Bonus free spins evaluate all 8 paylines at a 2Γ— multiplier for excitement.
  • Wilds multiply only the line(s) they appear on.

πŸ§ͺ Sample Output

+---+---+---+
| C | W | C |
+---+---+---+
| B | * | B |
+---+---+---+
| A | C | A |
+---+---+---+
Line 1 win: $8
Spin won: $8
Gamble win? (y/n):

Project Timeline

  • Jan 2025: Initial prototype built locally (basic 3Γ—3 reels, payouts)
  • Mar 2025: Added volatility presets, wilds/bonus, paylines, autospin, persistence
  • Aug 18, 2025: Cleaned up and published to GitHub (first public release)

How it Works (Quick)

  • Reels/Grid: 3Γ—3 grid; reels are sampled from a weighted symbol pool (volatility changes weights)
  • Paylines: Choose 3/5/8 (rows; +diagonals; +verticals). A line pays if all three match, wilds W substitute
  • Wilds: W substitutes and 2Γ— the payout for that line
  • Bonus: * does not pay on lines; 3 anywhere triggers 3 free spins @ 2Γ— (retrigger +1)
  • Gamble: Optional double-or-nothing on each win
  • Persistence: Balance + lifetime stats saved to slot_profile.json

Roadmap / Ideas

  • Configurable payouts/weights via config.json
  • Session analytics (hit rate, RTP estimate after N spins)
  • --no-color flag for dumb terminals; unit tests for payline logic

πŸ“ Files

.
β”œβ”€β”€ Python_Slot_Machine_Pro.py   # main script
β”œβ”€β”€ README.md                    # this file
β”œβ”€β”€ .gitignore                   # Python ignores
└── LICENSE                      # MIT

πŸ“ License

MIT Β© 2025 Yashvi Shah

About

Terminal slot machine in pure Python with volatility presets, wilds/bonus logic, selectable paylines, autospin, gamble feature, and persistent session stats.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages