Skip to content

Commit

Permalink
Remove console.log
Browse files Browse the repository at this point in the history
  • Loading branch information
mhluska committed Aug 2, 2021
1 parent c3078cc commit be97427
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
7 changes: 6 additions & 1 deletion src/node/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ export function printUsageOptions<T extends SimpleObject>(
const items = [` --${kebabCase(key.toString())}`];

if (value) {
items.push(options[key]?.formatter?.(value) ?? value);
let formattedValue = options[key]?.formatter?.(value);
if (formattedValue && formattedValue.includes('$')) {
formattedValue = `'${formattedValue}'`;
}

items.push(formattedValue ?? value);
}
if (options[key]?.hint) {
items.push(options[key]?.hint as string);
Expand Down
10 changes: 1 addition & 9 deletions src/simulator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,20 +193,12 @@ export default class Simulator {
const handsPerHour = 50;
const hoursPlayed = handsPlayed / handsPerHour;

const expectedValue = amountEarned / hoursPlayed;
const sd = standardDeviation(bankroll) / hoursPlayed;

const riskOfRuin = () =>
(1 - expectedValue / sd / (1 + expectedValue / sd)) ** ((100 * 100) / sd);

console.log('risk of ruin', riskOfRuin());

return {
amountEarned: Utils.formatCents(amountEarned),
amountWagered: Utils.formatCents(amountWagered),
betSpread: Utils.arrayToRangeString(
this.settings.playerBetSpread,
Utils.formatCents
(amount) => Utils.formatCents(amount, { stripZeroCents: true })
),
expectedValue: `${Utils.formatCents(amountEarned / hoursPlayed)}/hour`,
handsLost: Utils.abbreviateNumber(handsLost),
Expand Down

0 comments on commit be97427

Please sign in to comment.