Digital Mine Steem Lottery Game - Rules and How To Partecipate.

in steem •  6 years ago 

I would like to launch a lottery game, with the idea to add a bit of fun, and the possibility to win some money.

LogoMakr_3TBBGq.png

If the community will accept this project I'll publish a lottery round every day, and I'll pick the winner of the previous round.

Everything it's automated, and run by simple python programs I wrote and posted on github in order to keep the whole game fair, without human intervention.

To participate you should send 1 STEEM to digital.mine and write in the memo this message: "STEEM LOTTERY ROUND [insert the current round number]"
You can purchase as many tickets as you wish, for example if you wish to buy 10 tickets you should send 10 STEEM, and so on.
More tickets you purchase more chance to win you will get.

3 winners will be picked each day.

the 1st will get 50% of the jackpot
the 2nd will get 25% of the jackpot
the 3rd will get 15% of the jackpot

The house will get 10% of the jackpot

So if, for example, the total jackpot will be 100 STEEM

the 1st will get 50 STEEM
the 2nd will get 25 STEEM
the 3rd will get 15 STEEM

the house will get 10 STEEM.

Every day there will be a winner, and the STEEM will be transferred from this account.

Here the code to keep tracks of the tickets sales, and pick up the winner:

from steem import Steem
from steem.blockchain import Blockchain
from steem.post import Post
import re
import random

b=Blockchain()
s=Steem()

tickets=[]
ti=[]
pick=[]
tot=[]

def check():
    t=s.get_account_history(account='digital.mine',index_from= -1, limit=10000)
    for i in t:
        if 'transfer' in str(i):
            fro=re.findall("'from': '(.+?)'",str(i))
            amount=re.findall("'amount': '(.+?)'",str(i))
            memo=re.findall("'memo': '(.+?)'",str(i))
            id_=re.findall("'trx_id': '(.+?)'",str(i))
            for i,x,y,z in zip(fro,amount,memo,id_):
                if 'a gift' in y.lower():
                    if z not in tickets:
                        print ('id',z)
                        print ('from',i)
                        print('amount',x)
                        print('memo',y)
                        tickets.append(z)
                        ti.append((i,x))



    for i in ti:
        tik=float(i[1].split(' ')[0])
        if tik>=1:
            while tik>0:
                pick.append(i[0])
                tot.append(tik)
                tik-=1  
        else:
            print ('less than 1',i)
    

def winners():
    random.shuffle(pick)
    print ('First', pick[0])
    pick.remove(pick[0])
    random.shuffle(pick)
    print ('Second', pick[0])
    pick.remove(pick[0])
    random.shuffle(pick)
    print ('Third', pick[0])
    print ('TOTAL JACKPOT',sum(tot))

check()
winners()

The round post will be updated with comments on the current ticket sales, and total jackpot.

I'm planning to launch the first round tomorrow around this time.

Please fell free to comment, with your suggestions or doubts.

Thanks for reading!

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Hello! I am upvoting service and this post has been found valuable and upvoted. Wish you all the best! :)

Follow @voter01 to get biggest votes in your next posts

Congratulations @digital.mine! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

You made more than 1500 upvotes. Your next target is to reach 1750 upvotes.

Click here to view your Board
If you no longer want to receive notifications, reply to this comment with the word STOP

To support your work, I also upvoted your post!

Do not miss the last post from @steemitboard:

Christmas Challenge - The party continues
Christmas Challenge - Send a gift to to your friends

Support SteemitBoard's project! Vote for its witness and get one more award!

Congratulations @digital.mine! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

You received more than 50 as payout for your posts. Your next target is to reach a total payout of 100

Click here to view your Board
If you no longer want to receive notifications, reply to this comment with the word STOP

Do not miss the last post from @steemitboard:

Christmas Challenge - The party continues
Christmas Challenge - Send a gift to to your friends

Support SteemitBoard's project! Vote for its witness and get one more award!