I would like to launch a lottery game, with the idea to add a bit of fun, and the possibility to win some money.
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!
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
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Congratulations @digital.mine! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :
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:
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Congratulations @digital.mine! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :
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:
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit