Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- use strict;
- use warnings;
- my $bitcoin = "/home/diablo/code/bitcoin/bitcoin-0.8.1-linux/bin/64/bitcoind";
- my $start_btc = 33;
- my $bet_size = 1;
- my $command = "listtransactions \"\" 99999999999999999";
- my $filter1 = "| grep amount | grep ";
- my $filter2 = " | wc -l";
- my %search = (
- 64000 => '1.004',
- 60000 => '1.071',
- 56000 => '1.147',
- 52000 => '1.235',
- 48000 => '1.338',
- 32768 => '1.957',
- 0 => '0.005',
- );
- my $count = 0.0;
- my $money = 0.0;
- foreach my $level (sort { $search{$a} <=> $search{$b} } keys %search) {
- my $amount = $search{$level};
- my $c = `$bitcoin $command $filter1 $amount $filter2`;
- my $m = $c * $amount;
- $c =~ s/\n//;
- if($level != 0) {
- printf("%5u: %4u tries = %8.3f BTC\n", $level, $c, $m);
- } else {
- printf(" Fail: %4u tries = %8.3f BTC\n", $c, $m);
- }
- $count += $c;
- $money += $m;
- }
- printf "\n";
- printf("Total: %4u tries = %8.3f BTC\n", $count, $money);
- my $avg_winnings = $money/$count;
- printf("Average winning: %f%%\n", ($avg_winnings - 1) * 100);
- my $winnings = $start_btc;
- for(my $i = 0; $i < $count; $i += $winnings * $bet_size) {
- $winnings *= $avg_winnings;
- }
- printf("Actual winnings: %4.3f%%, %4.3f BTC -> %4.3f BTC\n", ($winnings - 1) * 100, $start_btc, $start_btc * $winnings);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement