Daily reward scales with streak length + milestone bonuses
๐ Daily MissionsResets in --:--
Loading missions...
๐ Achievements0/100
๐ Unclaimed Rewards+0g
--
0
Bets Survived
0
Peak Balance
$100
Final Balance
$100
Roll Result0.00
0255075100
Bet: $0.00Balance: $100.00
Recent Bets
#
Roll
Target
Result
Balance
๐ป Code Your Strategy
|Ready
Strategy API
function onRoll(won, profit, currentBalance) { return { amount, target: 49.5 }; // roll-under %, payout auto-set for 1% house edge }
๐ Console
Console ready. Use console.log() in your strategy to debug.
โ๏ธ Strategy Controls
coins
๐๐ถ๐โก
๐ Performance Breakdown
Win Rate โ0%
Total Wagered โ$0
Biggest Win$0
Longest Streak0
Max Drawdown โ0%
Avg Bet โ$0
End Reason--
๐ฒ Welcome to Beat the House
Can you code a strategy that survives as long as possible?
1Edit the code (or try a template)
2Click "Run Simulation"
3Watch your strategy survive (or crash)
4Tweak and try to beat the leaderboard!
๐ฃ Share Your Score
Generate a post-ready message.
๐ฐ Confirm Gold Stakes
Stake 0 gold coins to run 0 bets?
You'll keep your winnings if your balance increases!
๐ Provably Fair Verification
Verify the fairness of dice rolls using cryptographic seeds.
--
0
All dice rolls are generated using a provably fair
algorithm:
Each simulation uses a server seed
(hidden until revealed) + client seed (auto-generated) +
nonce (increments per roll)
The server seed hash is shown before
the simulation runs
After the simulation, click "Reveal Server Seed" to see
the actual seed
You can verify that hash(serverSeed) matches the hash shown before the run
This proves the rolls were
predetermined and not manipulated based on your strategy.
๐ฎ
Welcome to Beat the House!
An interactive coding challenge where you control a
betting bot
๐ฏ Your Mission:
Write JavaScript code that controls a betting
strategy and survives as long as possible against a 1% house edge. Can you climb to the
top of the leaderboard?
โก How This Works:
You'll code a function that decides bet amounts and risk levels
Run simulations instantly to test your strategy
Compete on the leaderboard with other coders
Unlock template strategies after your first run
Tutorial Time
~3 minutes
๐ป
The Strategy Function
Your strategy is defined by one function called
after every bet:
function onRoll(won, profit, currentBalance) {
// Your logic here
return {
amount: 1, // Bet size
target: 49.5 // Win % (49.5% = 2x payout)
};
}
๐ฑ๏ธ Click the
highlighted code to learn:
1
function onRoll(...) - Your Strategy Function
This function is called after every bet. It receives three parameters:
won: Did the last bet win? (true/false)
profit: How much $ won or lost last bet
currentBalance: Your current balance
Use these to decide your next bet!
2
Your Strategy Logic
This is where you decide what to do next based on whether you won/lost.
Track streak counters, adjust risk, or implement any strategy you can
imagine!
3
amount - Your Next Bet
This is the $ amount you'll bet next. Common strategies:
Fixed: Always bet $1
Martingale: Double after loss, reset after win
Percentage: Bet % of current balance
4
target - Win Probability %
This controls your odds:
49.5% = 2x payout (safe)
25% = 4x payout (risky)
10% = 10x payout (very risky!)
Lower % = higher risk but bigger rewards if you win.
โ Great! You've explored all four parts. Ready to write your first
strategy?
โก
Task 1: Modify Your
Strategy
๐ Your First Coding
Challenge
We've loaded a simple strategy in the code editor. Your task is to make it smarter by changing the bet amount based on
wins and losses.
๐ฏ Step-by-Step
Instructions:
Click "Close Tutorial" below to see the
code editor
Find the comment // TODO: Make this smarter!
Change the bet logic to double after losses:
if (won) {
currentBet = 1; // Reset to $1 after win
} else {
currentBet *= 2; // Double after loss
}
Click the ๐ RUN button to test your
strategy
๐ก Bonus Ideas
(Optional):
Add a safety check: stop doubling if bet exceeds $100
Bet a percentage of currentBalance instead of fixed amounts
Track win/loss streaks and adjust accordingly
Return null if currentBalance drops below $50 (stop-loss)
๐ก Hint:The
won parameter tells you if the last bet won (true/false). Use an
if/else statement to change currentBet differently for
wins vs losses.
๐
Modify Code
๐
Run Simulation
โ
Complete!
๐
Congratulations!
You've completed your first simulation!
Your strategy survived 0 bets.
Can you improve it to beat the leaderboard?
๐ Unlocked Features:
๐ฏ
Templates
Study proven strategies
๐
Leaderboard
Compete globally
๐
Analytics
Track performance
๐ What's Next:
Experiment with different betting strategies
Check out the template strategies for inspiration
Try to reach the top of the leaderboard
Share your scores and challenge friends
๐ฅ Pro Tip:The
house always wins in the long run (1% edge), but the challenge is surviving as long
as possible. Focus on risk management and bankroll preservation!
๐
๐ฏ Weekly Challenge
First
Steps Challenge
Challenge Resets In:
--
๐ Rules to Qualify:
๐ How to Win:
๐ก Strategy Tips:
๐ฌ Send Feedback
Have a bug report, feature request, or just want to share your thoughts? We'd love to hear from
you!
0/1000 characters
How It Works
The Game
Write JavaScript code to control
a dice betting bot. Your strategy runs thousands of simulated bets instantly. The goal:
survive as many bets as possible before going broke.
Each bet has a 1% house edge. You will lose
long-term - the question is how long you can last.
Your Code
Define an onRoll(won, profit, currentBalance)
function that returns bet parameters:
function onRoll(won, profit, currentBalance) {
return {
amount: 10, // Bet size in dollars
target: 49.5, // Win probability %
multiplier: 2.0 // Payout on win
};
}
The currentBalance parameter tells you your current balance. Return null
to stop the simulation early.
Leaderboard Rules
Runs must meet minimum
requirements to qualify. These the usage of strategies meant to manipulate the leaderboard.
๐ House Score
Balanced
survival, growth, volume, win quality, risk, and code complexity.
Minimum: 10,000 bets
Average bet: $0.50 or higher
Total wagered: $5,000+
Max drawdown: 50%
Win rate: 25-80%
๐ Peak Balance
Highest
balance achieved during simulation. Who can grow their bankroll the most?
Minimum: 1,000 bets
Average bet: $1.00 or higher
Total wagered: $10,000+
Max drawdown: 40%
Win rate: 30-75%
โญ Weekly Challenge
Special
constraints that change every Monday. Check the ticker at the top for this week's rules.
Why Constraints?
Without constraints,
competition would be uninteresting:
No minimum bet: Bet $0.0001 or less for millions of rounds
No drawdown limit: No incentive to preserve capital
No win rate range: Bet on 99.99% probability rolls
Constraints are in place to
incentivize creative strategies and are subject to change at any time based on community
feedback and internal testing.
๐ Provably Fair
All dice rolls use HMAC-SHA256, the same
cryptographic algorithm used by real casinos. Click "Provably Fair Verification" after any
run to independently verify the results.
๐ Global Leaderboards
๐ Leaderboards update in real-time. Compete for the top spot!
๐ Hey there!
dev here! You've been here for 20 minutes. ๐
Would you mind sharing what is keeping you here, and what would make you come back?
0/500 characters
Your feedback helps shape what we build next. Thanks for being an early user! ๐