Newbie amateur game dev here! I've been programming for a few years now, mostly for academic/scientific purposes. I've always wanted to try my hand at making games, but I've always found an excuse not to.
So screw that, I'm starting from zero in a new language doing the absolute minimum that I can call a "thing" and here it is: a very simple histogram tool that "rolls" virtual dice and displays the frequency of the different rolls (excluding events with zero-frequency).
I'm used to doing this with more sophisticated tools and ad-hoc libraries, learning to do things «by hand» is a challenge in and of itself.
The histograms do not generally follow the distribution that one would expect. I believe this happens because:
- Strong cryptographic principles and robust (pseudo-)random number generation is outside the scope of a tool like Pico-8, and
- Andy has screwed something in the code and prefers to publish something imperfect rather than trying to perfect it and never publish it.
So here it is, a small tool that will expose me and might help someone in the future.
Customization
Ideally, you should only need to customize three things:
rolls
is how many times you will try the experiment; in a real-life situation you want this to be largedpr
is how many dice you're rolling each time. It's the first number in the common dice notation (1d8)ds
is the dice size, or how many faces the virtual dice have. Common dice for D&D are obviously 4, 6, 8, 10, 12, and 20; but one can customize it to other numbers for «impossible» dice.
What else?
I haven't tested this with larger numbers, mostly because P8 is not the tool for such rigorous analysis and data visualization. Use large numbers at your peril.