xori / gamblers-dice Goto Github PK
View Code? Open in Web Editor NEWA terrible idea, now real.
Home Page: https://xori.github.io/gamblers-dice
License: ISC License
A terrible idea, now real.
Home Page: https://xori.github.io/gamblers-dice
License: ISC License
Just kidding, but also this is fun and cool :)
Math.random()
could give 0
in which case steps
is 0
and the subsequent loop would never run; therefore target
would still be 0
.
Changing the loop condition to steps >= 0
fixes this issue.
I think it would be even better if rolling a 3 would make it less likely that the next roll would be a 3, and rolling two 3s would make it even less likely to roll a third, etc. This should still keep it uniformly random over time but would make it marginally funnier.
You could populate each side like a deck of cards...
1000 1's
1000 2's
1000 3's
Then, when people rolled, eventually they would reach true uniformity (in this example after 3000 rolls)
Maybe have this accessible by a different "engine" property, (or "algorithm", or "sampleType" or whatever you want to call it)
You could also pick the initial sample size (aka, reaches uniformity every 1000, or every 10, or every 100).
This would allow people to 'count cards' in a sense ( count die ).
Just an idea!
And, people would think "I haven't rolled 3 in a while", they'd be right to think that because there are a lot of 3's left in the "deck".
So i tried this and if i understand correctly this dont work . tried with 4 also. help.
https://www.webpackbin.com/bins/-KpU3Tf83tTgzq_Xxq1o
its always uniformly distributed .
Me? I am a data scientist for a company that makes slot machines. I know a thing or two about probabilities. I freaking love this. I can see a game being made using this. Not a gambling game, because it would never get past even the most easily bought off federal compliance officer in the land. However, regular games could benefit from this mechanism. A system where you luck is always turning on you...
Also, to ensure your odds, you need very high entropy. Sure, go ahead and use your mersene twister. Its the defacto default. However, if you ever go live with something that depends upon this for millions of game sessions (hey, think BIG), then use any one of several schemes to insure the entropy is excellent. Like sigma 15 excellent.
You can mark this closed. Its just a suggestion! Good work!
Just letting it be known that I'd be interested in a Python 3 port
I was bored and saw this, and thought, how hard could it be?
https://github.com/eukaryote31/gamblers-dice
Now this atrocity spans multiple languages! If you ask me, that's the best thing since goto!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.