Add roulette bankroll calculator and update roulette pages to link to it#148
Add roulette bankroll calculator and update roulette pages to link to it#148shelialynn304 wants to merge 5 commits into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 73b29a5555
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| <head> | ||
| <meta charset="UTF-8" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
| <meta name="robots" content="index, follow" /> |
There was a problem hiding this comment.
Add the new indexable page to the sitemap
Because this new root HTML page is marked indexable and has its own canonical URL, it also needs a sitemap.xml entry. I checked the repo’s audit path by running node scripts/site-audit.js, and scripts/site-audit.js requires every non-ignored root HTML file to be mapped in the sitemap; the current commit fails with root HTML page missing from sitemap.xml: roulette-bankroll-calculator.html.
Useful? React with 👍 / 👎.
| const bankroll = Number.parseFloat(document.getElementById("startingBankroll").value); | ||
| const betSize = Number.parseFloat(document.getElementById("betSize").value); | ||
| const spinsRaw = Number.parseFloat(document.getElementById("spinCount").value); | ||
| const spins = Number.parseInt(document.getElementById("spinCount").value, 10); |
There was a problem hiding this comment.
Parse the spin count with Number instead of parseInt
When a browser number input contains exponent notation such as 1e3, spinsRaw parses as the valid integer 1000, but this line turns the same field into 1, so the calculator reports expected session loss and pressure for one spin instead of 1,000. Since the validation uses spinsRaw, these inputs pass and silently produce incorrect roulette bankroll results; use the already-validated numeric value rather than parseInt here.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Summary
- Fixed the roulette bankroll calculator spin parsing by using the already parsed numeric
spinsRawvalue forspins, preventing exponent notation like1e3from being silently treated as1byparseInt. roulette-bankroll-calculator.htmlL474-L479 - No formulas changed.
- Committed the change with commit
56690d4and created a PR titledFix roulette bankroll spin count parsing.
Testing
- ✅
node scripts/js-syntax-check.js - ✅
node scripts/math-sanity-check.js - ✅
node scripts/site-audit.js - ✅
node --check /tmp/roulette-bankroll-inline.js - ✅
node - <<'NODE' const input = '1e3'; const spinsRaw = Number.parseFloat(input); const spins = spinsRaw; if (!Number.isFinite(spinsRaw) || !Number.isInteger(spinsRaw) || spins <= 0) { throw new Error('exponent spin input should validate as a positive integer'); } if (spins !== 1000) { throw new Error(\expected exponent spin input to remain 1000, got ${spins}`);
}
NODE`
…oulette-bankroll-calculator-and-update Fix roulette bankroll spin count parsing
Motivation
Description
roulette-bankroll-calculator.htmlwith the requested title, canonical (https://edgeoverluck.com/roulette-bankroll-calculator.html), meta description, shared header/footer, and site styling.Starting bankroll,Bet size per spin,Number of spins,Wheel type(European/American), andBet type(straight, split, street, corner, six line, dozen, column, even-money), plus validation that prevents impossible values.win probability,house edge / expected loss rate,expected loss per spin,expected session loss,bankroll units,spins until expected loss equals bankroll, aLow/Medium/High/Extremesession pressure rating, and a plain-English explanation; European (37) and American (38) pocket math and payouts follow the repo math rules.How toandFAQvisible sections and matchingHowToandFAQPageJSON-LD blocks, aWebPageJSON-LD block, and internal links to the roulette toolkit; added light, scoped CSS and in-page vanilla JS (no frameworks).roulette.html,roulette-calculator.html,roulette-simulator.html, androulette-strategy-simulator.htmlwere updated to include links toroulette-bankroll-calculator.htmlwhere appropriate, while leaving legitimate blackjack links intact.roulette-bankroll-calculator.html(new),roulette.html,roulette-calculator.html,roulette-simulator.html,roulette-strategy-simulator.html.Testing
node scripts/js-syntax-check.jsandnode scripts/math-sanity-check.js, both passed successfully.node --check /tmp/roulette-bankroll-inline.jsand ran targeted formula assertions innodeto confirm house-edge and payout math matched expected values, all passing.html.parserchecks (no syntax errors found).node scripts/site-audit.jsran but reported one expected issue: the new page is not insitemap.xml(left unchanged because sitemap edits were out of scope for the allowed files).Codex Task