📜 ⬆️ ⬇️

How to lose money on the game of roulette

Periodically on the Internet, an advertisement about how to earn money for free in a virtual casino on a roll slips on the Internet. Here are examples of spomoni.habrahabr.ru/blog/9732/, ruletka.4t.com, biznesland.narod.ru. From the point of view of the theory of random numbers, we do not have a single chance to win a casino, but the craving for freebies is indestructible. Therefore, I wrote a small roulette emulator so that you can feel everything yourself.



Results: There is no chance to win the roulette. Any win will be replaced by a loss. People from the links above earn either affiliate programs with casinos (the casino pays them a part of the money you lost) or selling for 10 ye a super secret how to deceive the roulette (why sell it if you can use it?). In general, there is no freebie, but craving for freebies is a quick way to lose your money.
')
Slightly better code looks here bolnikh.ru/node/50 .

<?php

/**


/
"" ruletka.4t.com

spomoni.habrahabr.ru/blog/9732

ruletka.4t.com biznesland.narod.ru


1) ( 3 )
2) 1)
3) - , 1)


,

*/

mt_srand(make_seed());

$r = new Ruletka;
while ( true ) {
$r->game();
}

//------------------

class Ruletka {

var $budget = 10000; //
var $min_bid = 1; //
var $last_bid = 1; //
var $wait_rolls = 6; //
var $max_budget = 10000000; // ,
var $min_budget = 0; // ,

var $roll ; //

var $is_make_bet = false ; // (true) (false)

var $last_odd_count = 0; //

function game() {

if (!$ this ->is_make_bet) {
$ this ->roll();
if ($ this ->is_odd()) {
$ this ->last_odd_count++;
if ($ this ->last_odd_count >= $ this ->wait_rolls) {
$ this ->is_make_bet = true ;
$ this ->last_bid = $ this ->min_bid;
}
} else {
$ this ->last_odd_count = 0;
}
} else {
$ this ->bid();
$ this ->roll();
if ($ this ->is_odd()) {
$ this ->win();
} else {
$ this ->fail();
}
$ this ->check_game();
}

}

/**
*
*/
function roll() {
$ this ->roll = mt_rand(0,36);
}

//
function is_odd() {
if ($ this ->roll == 0) return false ;
return $ this ->roll % 2 == 0;
}

//
function is_even() {
if ($ this ->roll == 0) return false ;
return $ this ->roll % 2 == 1;
}

function bid() {
$ this ->budget -= $ this ->last_bid;
}

function win() {
$ this ->budget += 2*$ this ->last_bid;
$ this ->is_make_bet = false ;
$ this ->last_bid = $ this ->min_bid;
}

function fail() {
$ this ->last_bid *= 2;
}

function check_game() {

echo "budget = $this->budget\n" ;

if ($ this ->budget <= $ this ->min_budget) {
echo "You fail!!!!" ;
exit;
}
if ($ this ->budget >= $ this ->max_budget) {
echo "You win!!!!" ;
exit;
}
}

}

function make_seed()
{
list($usec, $sec) = explode( ' ' , microtime());
return ( float ) $sec + (( float ) $usec * 100000);
}


* This source code was highlighted with Source Code Highlighter .

Source: https://habr.com/ru/post/101760/


All Articles