Author

Topic: Classic Dice Rule (Read 89 times)

legendary
Activity: 1442
Merit: 1179
February 10, 2021, 12:48:50 AM
#4
Roll Under:

Code:
        $betAmt = 200; //example user input of bet amount
$probability = 30; //example user input percentage chance of a win
$multi = 100 / $probability; // this is your multiplier
$multi2 = $multi - 0.02; // this is your house edge
$grossProfit = $betAmt * $multi2;
$netProfit = $grossProfit - $betAmt;
        $target = 100 / $multi; // target to roll under (same as probability)


Roll Over:

Code:
        $betAmt = 200; //example user input of bet amount
$probability = 30; //example user input percentage chance of a win
        $multi = 100 / $probability; // this is your multiplier
$multi2 = $multi - 0.02;  //house edge
$grossProfit = $betAmt * $multi2;
$netProfit = $grossProfit - $betAmt;
        $target = 100 - $probability; //target to roll over
newbie
Activity: 25
Merit: 0
February 09, 2021, 01:45:05 PM
#3
Thanks for this.

I understand what you mean.

But when i make this, the result is the opposite. This is exactly what I have to solve.
legendary
Activity: 2114
Merit: 1292
There is trouble abrewing
February 09, 2021, 01:13:22 PM
#2
multiplier does 2 things.
1. decide how much the user wins in case they win. for example 2x multiplier means user receives the same amount they put in (1 satoshi : wins 1 satoshi), 3x means they receive 2 times more (1 satoshi wins 2 satoshi).

2. decides the chance by splitting the number range into a smaller range. for example 2x would split it into half meaning if the roll is from 0 to 100 then low would be from 0 to 50 and high would be from 50 to 100. 3x splits it to 3 parts and use 1/3 (0 to 33, 66 to 100). anything in between is loss.
you should also add the house edge which turns 0 to 50 into 0 to 47 for example depending on the edge.
newbie
Activity: 25
Merit: 0
February 09, 2021, 01:03:10 PM
#1
Hello

I want to know classic dice rule. so i maked a simple example for this.

There is 3 field:

Code:
Roll Under:


Win Chance:


Multiplier (Payout):

And Range:

Code:

And javascript code:

Code:
$('#range').change(function(e){

   let val = parseFloat($(this).val());
  
  $('#roll').val(val.toFixed(2));
  $('#chance').val(val.toFixed(4));
  $('#multiplier').val('How can calculate');

})

multiplier field have a formula. How can calculate this field ?
Jump to: