5 Replies Latest reply on May 19, 2007 5:54 PM by cerdas

    best way to process bingo winners

    cerdas Level 1
      hello, im development a bingo game multiuser but i have a trouble, how i can get the winners? i do the follow:
      1. for each ticket i make a list with all the possible combinations according with the pattern.
      2. with each called number i take out from the combinatinos list the number.
      3. when some list lengh is 0 means somebody wins.

      It works perfect! but takes too much resources, because some patters can have more that 1 combination, and players can get a lot of tickets, then is too much data to process, some idea about how make it better?

      ty!
        • 1. Re: best way to process bingo winners
          johnAq Level 1
          if I follow what youre saying it soundslike Step 1 is where the hold up is, but I'm not sure what you mean by a 'pattern'. How are you assigning numbers to each ticket?

          johnAq
          • 2. Re: best way to process bingo winners
            Level 7
            Are you assuming that it will be too slow or have you actually experienced
            this? If you are experiencing a slow response you may need to post some of
            your code for anyone to offer a suggestion. Director can loop through very
            large lists quickly doing comparisons in almost no time if you have coded it
            correctly (on a reasonably modern processor of course).


            "cerdas" <webforumsuser@macromedia.com> wrote in message
            news:f2jdg7$2qc$1@forums.macromedia.com...
            > hello, im development a bingo game multiuser but i have a trouble, how i
            > can
            > get the winners? i do the follow:
            > 1. for each ticket i make a list with all the possible combinations
            > according
            > with the pattern.
            > 2. with each called number i take out from the combinatinos list the
            > number.
            > 3. when some list lengh is 0 means somebody wins.
            >
            > It works perfect! but takes too much resources, because some patters can
            > have
            > more that 1 combination, and players can get a lot of tickets, then is too
            > much
            > data to process, some idea about how make it better?
            >
            > ty!
            >


            • 3. Re: best way to process bingo winners
              cerdas Level 1
              ok let me explain me better:
              bingo patterns are the combinations for example 4 corners, any line... etc.

              for each ticket i use 24 random numbers betwen 1 and 75.
              Then for each ticket i extract the a winner list, for example to 4 corners:

              winner_comb=[]
              repeat with a=1 to tickets.count
              winner_comb.add("b"&a&1)
              winner_comb.add("b"&a&5)
              winner_comb.add("o"&a&1)
              winner_comb.add("o"&a&5)
              end repeat
              for example if you get 1 ticket your winner_comb = ["B11", "b15", "011", "o15"]
              that may means something like : [3, 7, 73, 65] i send that list to the server that process the tickets, the server side runs a random list between 1 and 75 (the bingo caller), then i go to the previous list ([3, 7, 73, 65] ) and if the number exist on the list i just delete it, when the list haves 0 records means that the owner of the ticket wins, the trouble is that for each ticket is 1 list, if 1 player buy 50 tickets means 50 list, and if you have 100 players playing then you have 5000 list... i run it on test mode with 10 players and is good, but with 40 players the server crash (to slow to process the list) but i cannot figure out other way to process the ticket.

              ty for your help and time!!
              • 4. Re: best way to process bingo winners
                johnAq Level 1
                So is the server provessing everything for all the players? Can you have the players computer processing just their tickets - distributing the computing required?

                hth

                johnAq
                • 5. Re: best way to process bingo winners
                  cerdas Level 1
                  ty johnAq i move the tickets validation to the client side, now it runs very good... if somebody wanna see it go to www.bingoisus.com
                  tyev1