Skip to content
View dsetzer's full-sized avatar

Block or report dsetzer

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Maximum 250 characters. Please don't include any personal information such as legal names or email addresses. Markdown supported. This note will be visible to only you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse

Pinned Loading

  1. Dynamic Pattern System v1.4 work in ... Dynamic Pattern System v1.4 work in progress prototype for bustabit/bustadice scripts.
    1
    // ----------------------- V1.4 -------------------------
    2
    // This utility function will check an array of game results for a given pattern and return the most recent occurrence of a
    3
    // match. The pattern is specified using a regex-style syntax that uses the available tokens defined in the token list. The
    4
    // token list is an array of objects containing a token letter and a callback function that is used to check if the game results
    5
    // match the specified condition. It returns an array containing the game result objects for the matched results.
  2. A few martingale oriented inverse ut... A few martingale oriented inverse utility functions.
    1
    /**
    2
     * Calculates the base bet from the current wager, multiplier, and streak.
    3
     *
    4
     * @param {number} wager - The current wager.
    5
     * @param {number} multi - The multiplier.
  3. Probability functions (codex generated) Probability functions (codex generated)
    1
    // Cumulative Geometric Probability
    2
    function getGeoProb(p, n) {
    3
      return (1 - Math.pow(p, n)) / (1 - p);
    4
    }
    5
    
                  
  4. A set of Array utils which I use (It... A set of Array utils which I use (It should be noted that some are dependent on others)
    1
    // Calculates the sum of the items in the array.
    2
    // The sum is the result of adding all the items together.
    3
    Array.prototype.sum = function(){
    4
    	return this.reduce((a, b) => a + b);
    5
    }
  5. Iterative run probability Iterative run probability
    1
    // Probability of a r or more consecutive heads in n tosses
    2
    // of a coin having probability p of heads
    3
    // P(i) = P(i-1) + [1 - P(i-r-1)] * (1-p)p^r, for i > r
    4
    // P(r) = p^r
    5
    // P(i) = 0, for i < r
  6. bustabit median helper function bustabit median helper function
    1
    engine.median = function (span) {
    2
    	let arr = engine.history.slice(0, (span ? Math.max(1, Math.min(50, span)) : 50)).map(a => a.bust).sort((a, b) => { return a - b })
    3
    	let mid = arr.length / 2, med = mid % 1 ? arr[mid - 0.5] : (arr[mid - 1] + arr[mid]) / 2;
    4
    	return med;
    5
    };