Bitcoin Forum
June 23, 2018, 06:40:45 PM *
News: Latest stable version of Bitcoin Core: 0.16.1  [Torrent]. (New!)
 
   Home   Help Search Donate Login Register  
Pages: « 1 [2] 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 »  All
  Print  
Author Topic: Double Trouble (Instant/Automatic) w/ Partial Refunds! [12hr rounds]  (Read 29775 times)
Man From The Future
Sr. Member
****
Offline Offline

Activity: 336
Merit: 250


“Blockchain Just Entered The Real World”


View Profile
June 18, 2011, 12:23:42 AM
 #21

And another entry Smiley

I do like an automated one, as it leaves no room for someone accidentally forgetting to add soemthing to a spreadsheet. (Although bugs could be disastrous).

edit: And more! Cheesy

      ███████████████████████
     ███▄ ▄▄▄▄   ▄▄▄█▀▀  █████
    ███  █▀  ▀█▀▀▀       ▐█ ███
   ███  ▄██▄▄█▀▄▄▄        █▌ ███
  ███ ▄█▀  █     ▀█▄▄     ▐█  ▐██
 ███▄█▀    █        ▀█▄▄  ▄▄▄ ██
████▀      █           ▀██▀   ▀█ ██
 ██▀█▄     █          ▄█▀▀█▄▄▄█▀██
  ██ ▀█▄   █      ▄▄█▀▀    ▐█  ██
   ██  ▀█▄█▀▀█▄▄█▀▀        █▌ ██
    ███  █▄  ▄█▀█▄▄▄      █▌███
     ███  ▀▀▀▀     ▀▀▀█▄▄▐████
      ███████████████████████

 ▄▄       ▄▄▄        ▄▄   ▄▄▄▄▄ 
  ▀█▄   ▄█▀ ▀█▄    ▄█▀ ▄█▀▀   ▀▀█▄
    ▀█▄█▀     ▀█▄▄█▀  ▐█         █▌
    ▄█▀█▄      ▄█▀    ▐█         █▌
  ▄█▀   ▀█▄  ▄█▀       █▄       ▄█
▄█▀       ▀██▀          ▀▀█▄▄▄█▀▀


Network
BLOCKCHAIN JUST ENTERED THE REAL WORLD
  Decentralized Crypto-Location Oracle Network
GET WHITELISTED FOR TOKEN SALE ( Limited )

WHITE PAPER  ││  ANN Thread  Telegram   Medium   Twitter   Reddit
The World's Betting Exchange

Bet with play money. Win real Bitcoin. 5BTC Prize Fund for World Cup 2018.

Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1529779245
Hero Member
*
Offline Offline

Posts: 1529779245

View Profile Personal Message (Offline)

Ignore
1529779245
Reply with quote  #2

1529779245
Report to moderator
1529779245
Hero Member
*
Offline Offline

Posts: 1529779245

View Profile Personal Message (Offline)

Ignore
1529779245
Reply with quote  #2

1529779245
Report to moderator
NothinG
Hero Member
*****
Offline Offline

Activity: 560
Merit: 500



View Profile
June 18, 2011, 01:06:03 AM
 #22

Yeah, my most recent bug was found when a new game starts.
It's suppose to send everyone who didn't get doubled their money back, but their was a flaw.

I think what I'm going to do is:
((Amount in Pot)/(Total Amount Unpaid))/(Total # of Unpiad)

I'm still working out the rest of this (such as the weight[amount] per person).

lemonginger
Full Member
***
Offline Offline

Activity: 210
Merit: 100


firstbits: 121vnq


View Profile
June 18, 2011, 01:08:05 AM
 #23

what happened to the refund?

(for those of you that don't realize it, there can be no refund in a game like this unless OP wants to pay out of their own pocket. By it's nature the "last entry" gets eaten up paying out the entries before it.)
NothinG
Hero Member
*****
Offline Offline

Activity: 560
Merit: 500



View Profile
June 18, 2011, 01:15:09 AM
 #24

what happened to the refund?

(for those of you that don't realize it, there can be no refund in a game like this unless OP wants to pay out of their own pocket. By it's nature the "last entry" gets eaten up paying out the entries before it.)
If you haven't read my post right above yours I am trying to work out a way to at least give Some of the money back.

I'm thinking about taking the pot at the end of the game, finding out what percent of the money goes to who and I take a 2% fee from each person.
(Math is still a work-in-progress).


Well there ya go, paid out that quick.  I think I will play again with winnings.  Thanks OP.  btw when does this game end?
Roughly midnight, then the game restarts.

NothinG
Hero Member
*****
Offline Offline

Activity: 560
Merit: 500



View Profile
June 18, 2011, 01:24:09 AM
 #25

Well there ya go, paid out that quick.  I think I will play again with winnings.  Thanks OP.  btw when does this game end?
Roughly midnight, then the game restarts.

What time zone are you in?  Just trying to calculate time left.
It's actually the servers timezone.
I'll add it on the front page (how much time is left before game restarts).

lemonginger
Full Member
***
Offline Offline

Activity: 210
Merit: 100


firstbits: 121vnq


View Profile
June 18, 2011, 01:24:24 AM
 #26

If you haven't read my post right above yours I am trying to work out a way to at least give Some of the money back.

I'm thinking about taking the pot at the end of the game, finding out what percent of the money goes to who and I take a 2% fee from each person.
(Math is still a work-in-progress).

Fair enough.

Though you should at least work it out in a basic spreadsheet and see that depending on how the betting goes, people could be getting back very small fractions of what they put in.

Also there should be a countdown clock until reset.
lemonginger
Full Member
***
Offline Offline

Activity: 210
Merit: 100


firstbits: 121vnq


View Profile
June 18, 2011, 01:25:09 AM
 #27

wow I love it when a feature gets added seconds /before/ I post Smiley
WiseOldOwl
Full Member
***
Offline Offline

Activity: 238
Merit: 100



View Profile
June 18, 2011, 01:33:38 AM
 #28

Whats up, looks nice and clean. Got my shiny 2 btc dished out automatically
NothinG
Hero Member
*****
Offline Offline

Activity: 560
Merit: 500



View Profile
June 18, 2011, 01:35:22 AM
 #29

I'm going to stop working on the countdown timer until midnight but that's when the game resets. In other words, that's how long I have to perfect the refund code.
AHH! lol

Whats up, looks nice and clean. Got my shiny 2 btc dished out automatically
Hey Cheesy
I told you this game would be a hit.
Kind of surprised that I didn't think about the refund properly.

WiseOldOwl
Full Member
***
Offline Offline

Activity: 238
Merit: 100



View Profile
June 18, 2011, 01:49:30 AM
 #30

It was pretty late dude, and the concept was new. Hey but the program is pretty smooth:)
Are you doing a smaller time frame for the reset, or what ended up happening with that. I was thinking a big time frame was counter-productive.
NothinG
Hero Member
*****
Offline Offline

Activity: 560
Merit: 500



View Profile
June 18, 2011, 01:54:52 AM
 #31

It was pretty late dude, and the concept was new. Hey but the program is pretty smooth:)
Are you doing a smaller time frame for the reset, or what ended up happening with that. I was thinking a big time frame was counter-productive.
I ended up going with the game resetting at midnight.
Currently working on the math to split the current bank between users who haven't gotten paid (when the game resets).
The problem I am having is the weight each user has on the bank as to make the split fair.

WiseOldOwl
Full Member
***
Offline Offline

Activity: 238
Merit: 100



View Profile
June 18, 2011, 02:02:45 AM
 #32

Thats a toughy. Its different for each person.



Leftover pot
*
(
User_X's Unpaid Deposit Amount
divided by
Total amount of deposits of unpaid users
)

Then your fee
I dont know how to apply that to code

NothinG
Hero Member
*****
Offline Offline

Activity: 560
Merit: 500



View Profile
June 18, 2011, 02:07:42 AM
 #33

Okay, I believe I have it down (took me a while lol)...
Maybe I can get the communities input before I put it in place? I want to make sure this is fair for everyone.
Code:
usr[1] = 1
usr[2]= 1.5
brank= 1.7

count($Id) =2

$share_math = ( how_much_you_put_in * bank )  /  #ofPlayers_UnPaid ;

$share[1] =   ( 1 * 1.7 )  /  2 ;
$share[1]=  0.85;
$amount2send = $share[1] - ($share[1]/200); //2% gameover fee
$amount2send = 0.84575;
send(user,amount2send);

$share[2] =   ( 1 .5 * 1.7 )  /  2 ;
$share[2]=  1.275;
$amount2send = $share[2] - ($share[2]/200); //2% gameover fee
$amount2send = 1.268625;
send(user,amount2send);

Mind the $ and non $ switching. I do that when I code in notepad -> calculator before I move it into notepad++ xD

NothinG
Hero Member
*****
Offline Offline

Activity: 560
Merit: 500



View Profile
June 18, 2011, 02:16:24 AM
 #34

so what time zone are your servers in?  ie, how long till midnight?
Quote from: 'front page'
Current TIME: 10:15:51 PM
Cheesy 1hr and 45min left

NothinG
Hero Member
*****
Offline Offline

Activity: 560
Merit: 500



View Profile
June 18, 2011, 02:24:39 AM
 #35

Nice same as me.  So will you immediately post a new btc address at midnight for tomorrows game?
I don't use a specific BTC address for payments (well I do, hrm...maybe I should post it?).
It uses the SCI from mybitcoins.com (btw, if you use mybitcoins.com you can get free transactions instead of paying the program fee of 0.0005BTC. As the host, I still take the 1% and 2% fees).

The database goes through, splits the earnings (look a few post up about the math of that), deletes the database, and re-creates it.

[Edit]: The code is now in-place for refunds:
Code:
//get total amount the unpaid users have put in
$total = 0;
foreach($Id as $user)
{
$total = $Amount[$user] + $total; //they have in pot togeder
}

//spin for each user
foreach($Id as $userz)
{
$share[$userz] =  ( $Amount[$userz] * $total )/count($Id);
$amount2send[$userz] = $share[$userz] - ($share[$userz]/200); //take 2% for end of game fee ;D
mbc_spend($Address[$userz],$amount2send[$userz],"[BitDouble]: {End-of-Day} Refund!","");

//1 night, we need to logg this
$fh = fopen(--onebaddasshiddenfile--, 'a');
fwrite($fh, "[sending]: ".$amount2send[$userz]."\n");
fwrite($fh, "[Shares]: ".$share[$userz]."\n");
fwrite($fh, "[Account]: ".$Address[$userz]."\n\n");
fclose($fh);
}
This is the exact code I am using to split the shares.
If ANYONE sees anything wrong, please let me know!
ps, I am logging what get's shared for 1 night to make sure it goes smoothly. If not, having this log will allow me to see what went wrong.

WiseOldOwl
Full Member
***
Offline Offline

Activity: 238
Merit: 100



View Profile
June 18, 2011, 02:33:20 AM
 #36

Let me be the first to suggest running this one until 2moro nite...lol. Didnt know what time it was where you are.
NothinG
Hero Member
*****
Offline Offline

Activity: 560
Merit: 500



View Profile
June 18, 2011, 02:34:40 AM
 #37

Let me be the first to suggest running this one until 2moro nite...lol. Didnt know what time it was where you are.
So, instead of resetting each night...wait two nights?

WiseOldOwl
Full Member
***
Offline Offline

Activity: 238
Merit: 100



View Profile
June 18, 2011, 02:41:36 AM
 #38

 :-\yeah.?.?
Just this time because we didnt know what time it is. I dont really care that much but if other people feel the same way maybe.

Edit* Why'd my nervous/uneasy face come out like that??haha
NothinG
Hero Member
*****
Offline Offline

Activity: 560
Merit: 500



View Profile
June 18, 2011, 02:43:43 AM
 #39

Okay, I see.
I'll leave the first night (tonight) alone.
I'll have it setup so from tomorrow it will reset each midnight (clock is still going to be at the top).

[Edit]:
I added some code to the front page to:
1) Refresh every 30 seconds.
2) After it refreshes the first time you will notice ?pot_only is appended to the link. This will change the title to show how big the pot currently is. Saving you time from having to go back to the page and refreshing it every so often.

Hope everyone likes the updates. Cheesy


WiseOldOwl
Full Member
***
Offline Offline

Activity: 238
Merit: 100



View Profile
June 18, 2011, 03:05:26 AM
 #40

Nice!!
Thanks for letting it ride.
Pages: « 1 [2] 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 »  All
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!