Python Forum
Gui slot machine-out of memory error
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Gui slot machine-out of memory error
#11
thankyou deanhystad
but I am struggling to insert this and make it work
due to new or renamed variables or lists etc.
def spin_reels():
    """Pseudo spin, best I can do for now."""

    spinner = ['FH', 'FD', 'FC',
               'WH', 'WD', 'WC',
               'JH', 'JD', 'JC', 'JS',
               'QH', 'QD', 'QC', 'QS',
               'KH', 'KD', 'KC', 'KS',
               'AH', 'AD', 'AC', 'AS',
               'BH', 'BD', 'BC']

    Glo.hold_btn1.configure(state=DISABLED)
    Glo.hold_btn2.configure(state=DISABLED)
    Glo.hold_btn3.configure(state=DISABLED)

    for i in range(3):
        # Spin reel on X times, two 2X times, three 3X times
        for _ in range(18):
            for j in range(len(reel_labels)):
                # Don't spin a held reel.
                if not hold[j] and j >= i:
                    reel[j] = randrange(len(spinner_images))
                    reel_label[i].config(image=spinner_images[reel[i]])
            time.sleep(0.025)

    check_for_win()
    rnd_hold()
    save_bank()
Also my original description of spinr wasn't
quite right it's more this:
# spinr represents how many symbols to display for the spin.
# the bigger the value the longer the spin will take.
18seemed about right, but can be tweeked.

To know where I am coming from you really need to look
at the full game source and play a few reels to see the context.

I have uploaded the game to Github:
https://github.com/steveshambles/Freespin-Frenzy

cheers for your time again I appreciate it.
Reply


Messages In This Thread
RE: Gui slot machine-out of memory error - by Yoriz - May-17-2020, 01:49 PM
RE: Gui slot machine-out of memory error - by Yoriz - May-17-2020, 02:05 PM
RE: Gui slot machine-out of memory error - by steve_shambles - May-18-2020, 12:58 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Understanding and debugging memory error crashes with python3.10.10 Arkaik 5 2,175 Apr-18-2023, 03:22 AM
Last Post: Larz60+
  Memory Error While generating cheksum no mg24 2 1,073 Sep-25-2022, 10:33 PM
Last Post: mg24
  Help For Slot Machine Code Rayaan 1 2,749 Mar-30-2020, 05:01 AM
Last Post: SheeppOSU
  Memory consumption grows during execution only on single machine Jendker 2 1,918 Feb-10-2020, 01:57 PM
Last Post: Jendker
  Go around memory error Pytonormen 1 2,109 Oct-19-2019, 04:31 PM
Last Post: Gribouillis
  memory error using permutation list of 11 elements kikidog 1 3,924 Sep-10-2019, 08:22 PM
Last Post: ichabod801
  machine learning error (using jupyter) calonia 1 4,176 Jun-26-2019, 05:16 PM
Last Post: ThomasL
  Fix Memory Error while installing a library for Qgis alexastorga 0 2,607 Apr-13-2018, 04:54 PM
Last Post: alexastorga
  Dictionaries and memory error. jarrod0987 5 5,574 Feb-23-2018, 12:15 PM
Last Post: buran

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020