Thread Rating:
How would it be different than using the RND function? Or different than a file from random.org? (after 1D6 plus 1D6 processing for both, that is)
Quote: cowboycsv format 100 by 1000 or 1000 by 1000 would work for me.
How would it be different than using the RND function? Or different than a file from random.org? (after 1D6 plus 1D6 processing for both, that is)
Anything from random.org should be fine.
That is nice to use.Quote: MichaelBluejayMy site, Easy Vegas, has a Craps Rolls Generator. Let me know if you'd like the output in a different format.
Many will not use any computer generated rolls for a craps tester (actual rolls are wanted and prefered)
as both javascript and Excel have had serious issues in the past, especially failing most all statistical 'run' tests. (already well documented)
not that this is important, you use an interesting seed method for Math.random() I have never seen B4 (except from you) as seen in some of your code.
others have a Mersenne Twister implementation in javascript (that still has some issues as JS does not use arbitrary precision, but there seems to be good work-a-rounds) that can take a seed value to be able to always use the same results for testing.
example found here: https://gist.github.com/banksean/300494
It might be worth (or might not) getting the best possible code for this - even IF it is slightly slower than Math.random()
at least you added this to your site. better than nothing at all.
It's far better than "better than nothing at all", it's in fact absolutely useful with no downsides.Quote: 7crapsat least you added this to your site. better than nothing at all.
Javascript used an inferior random method until 2015 when it was upgraded to Xorshift+128, which is way more than adequate for this task. If someone will accept only actual craps rolls from a casino as legitimate, the problem is their delusion, not any actual inadequacy of my generator.
Here's a good table comparing different popular algorithms.
After some reading on the subject I agree.Quote: MichaelBluejayJavascript used an inferior random method until 2015 when it was upgraded to Xorshift+128, which is way more than adequate for this task.
a problem I have come across with Xorshift+128 is the seeding or that lack of it to produce repeatable results. My readings say the browser does the initial seeding unless one writes code for it. I have not yet looked into it as I do not intend to use javascript for simulations. (never say never) But some do just that.
But seeing things like this (Xorshift+128)
makes me want to learn how to avoid duplicating those results and getting results that look more like this
.
the top photo was using a seeding method I have seen used for Math.random()
example
die1 = Math.floor(Math.random(seed)*6)+1;
die2 = Math.floor(Math.random(seed)*6)+1;
I was under the impression that function does not take a seed. I could be wrong here too.
so much to learn if one wants to learn
Output showing the numbers of each individual die would be preferable. Without this your data is useless to hardway or hop bet players. For example, when your data generates an "8" did it come from a 6-2, 5-3, or 4-4? Providing the ability to download a file containing multiple rolls would be even better.Quote: MichaelBluejayMy site, Easy Vegas, has a Craps Rolls Generator. Let me know if you'd like the output in a different format.
Your site displays the following:
I tend to agree but there are many factors to consider and at any rate there are those who insist that real random numbers are the only way to go. For that, numbers obtained from random.org should suffice. However, there are those who claim that only real rolls from real tables are acceptable (as if real random vs craps table random are two different things). I author a simulator called WinCraps which allows you to deal with all these options.Quote:The only way to do test a system properly is to run a computer simulation (either one long session of millions of rounds, or thousands of short sessions).
Programming is not everyone's cup of tea especially if it means learning a full-blown programming language. I've tried to make it a bit easier by providing a language called "Auto-betting" for use in WinCraps It uses craps lingo, integrates easily with the game variables, and handles most of the overhead. For those who are still loath to write a program, there are dozens of free scripts available covering a multitude of systems.Quote:Running a computer simulation means either hiring someone to write the program (probably $100 would do it), or learning how to program it yourself (would probably take about a week). To hire someone, try Fiverr or Upwork. To learn programming, try Udemy, Code Academy, or Learn Python.
Steen
You're right, Math.random() is auto-seeded; I included the seed by mistake since I always just copy/paste my RNG code that I've been using for years. Since Math.random() doesn't take arguments, specifying a seed argument isn't supposed to change the results, but your scatter plot suggests that it does. Can you share the code or the website you used to generate the plots?Quote: 7crapsMy readings say the browser does the initial seeding unless one writes code for it.
https://github.com/lordpoint/xorshift-sandbox-and-visualizerQuote: MichaelBluejaySince Math.random() doesn't take arguments, specifying a seed argument isn't supposed to change the results, but your scatter plot suggests that it does. Can you share the code or the website you used to generate the plots?
the code in the scripts.js file I added and changed
now = new Date();
seed = now.getSeconds();
let y = 0;
let state0 = seed; //123; // SEED - change these to affect the apparent randomness of the outcome
let state1 = seed*seed; //234; // SEED - change these to affect the apparent randomness of the outcome
I really did not want to do more as I am not ready to learn about this and use it right now. stuck it all in a folder.
I did notice that when I did NOT use that (seed) in your code (another program of yours - Betting System Tests, I think), it ran just fine (I wondered why that was) and was a bit faster to me. I did not time it.
hope this helps out as many ask questions about Math.random() and setting a seed seems to be the most asked. a seed would be nice to have repeatable results for testing.
Good point, I added that option.Quote: SteenOutput showing the numbers of each individual die would be preferable. Without this your data is useless to hardway or hop bet players.
What format should that be in? A stream of individual dice, space-delimited?Quote: SteenProviding the ability to download a file containing multiple rolls would be even better.
Are you sure that's Xorshift+128? The project refers to it as "xorshift" in one place, and "xorshift+" in another (although they're separate algorithms), and never once says "xorshift+128" (which is yet another variation). There are yet others. Xorshift+128 is more robust than earlier incarnations.Quote: 7crapsBut seeing things like this (Xorshift+128)...
I downloaded the GitHub project and forced it to use Math.random() so I knew I'd be getting Xorshift+128:
if (Math.random(seed)<0.50) ...
That gave me a snow-like plot, with both a seed and without a seed. Maybe there's some reason that's not an apples-to-apples comparison vs. pulling bytes directly out of the algorithm for some reason, but I'm certainly satisfied with the snow-like plot, which suggests to me that my betting-system-test generators produce good results.
looking in the javascript files of the Craps gameQuote: krlyWhat type of RNG is used in the Wiz's craps game ?
uses Mersenne Twister in Javascript
var RNG = // Mersenne Twister
// adapted from http://gist.github.com/banksean/300494
var die1 = RNG.Next(6) + 1;
var die2 = RNG.Next(6) + 1;
var sum = die1 + die2; Game.Sum = sum;
Looks good except the come-out naturals are not displaying the individual dice.Quote: MichaelBluejayGood point, I added that option.
The options you've set are good, but I'd add space delimited and no-delimiters as options too.Quote: MichaelBluejayWhat format should that be in? A stream of individual dice, space-delimited?
Incidentally, downloading 500k or 1m files doesn't appear to work.
WinCraps users can open one of your files on the Dice Roll Files screen and enter them into a roll file using the "Paste from text file" option.
Steen
I fixed the display output to show individual dice on a non-point come-out, and I added "space" and "none" as delimiter options.
I'm able to download 500k and 1M files in Chrome, Safari, and Firefox, although sometimes in Chrome it takes a couple of tries. I doubt there's anything I can do on my end to fix that.