Add version number and best practices
This commit is contained in:
parent
1ebdfb15ee
commit
e2f3c8fc83
|
@ -0,0 +1,11 @@
|
|||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
|
||||
indent_style = space
|
||||
indent_size = 4
|
|
@ -0,0 +1,2 @@
|
|||
# Dice
|
||||
Given a set of dice, calculates the probability density graph of each value that can be rolled.
|
25
index.html
25
index.html
|
@ -5,18 +5,14 @@
|
|||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta name="author" content="Felix W. Dekker" />
|
||||
<meta name="application-name" content="Dice probabilities" />
|
||||
<meta name="description" content="Calculates the probability of throwing a value given a combination of dice." />
|
||||
<meta name="description" content="Calculates the probability of rolling a value given a combination of dice." />
|
||||
<meta name="theme-color" content="#0033cc" />
|
||||
|
||||
<title>Dice probabilities | FWDekker</title>
|
||||
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,300italic,700,700italic"
|
||||
crossorigin="anonymous" />
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css"
|
||||
integrity="sha256-l85OmPOjvil/SOvVt3HnSSjzF1TUMyT9eV0c2BzEGzU=" crossorigin="anonymous" />
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/milligram/1.3.0/milligram.min.css"
|
||||
integrity="sha256-Ro/wP8uUi8LR71kwIdilf78atpu8bTEwrK5ZotZo+Zc=" crossorigin="anonymous" />
|
||||
<link rel="stylesheet" href="https://static.fwdekker.com/css/milligram-common.css" crossorigin="anonymous" />
|
||||
<link rel="stylesheet" href="https://static.fwdekker.com/css/milligram-bundle.min.css" crossorigin="anonymous" />
|
||||
</head>
|
||||
<body>
|
||||
<main class="wrapper">
|
||||
|
@ -24,8 +20,15 @@
|
|||
<header class="header">
|
||||
<section class="container">
|
||||
<h1>Dice probabilities</h1>
|
||||
<noscript>
|
||||
<span style="color: red; font-weight: bold;">
|
||||
This website does not function if JavaScript is disabled.
|
||||
Please check the <a href="https://www.enable-javascript.com/">
|
||||
instructions on how to enable JavaScript in your web browser</a>.
|
||||
</span>
|
||||
</noscript>
|
||||
<blockquote>
|
||||
<p><em>Calculates the probability of throwing a value given a combination of dice.</em></p>
|
||||
<p><em>Calculates the probability of rolling a value given a combination of dice.</em></p>
|
||||
</blockquote>
|
||||
</section>
|
||||
</header>
|
||||
|
@ -41,7 +44,7 @@
|
|||
<thead>
|
||||
<tr>
|
||||
<th>Sides per die</th>
|
||||
<th>Number of throws</th>
|
||||
<th>Number of rolls</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
@ -81,6 +84,8 @@
|
|||
Licensed under the
|
||||
<a href="https://git.fwdekker.com/FWDekker/dice/src/branch/master/LICENSE">MIT License</a>.
|
||||
Source code available on <a href="https://git.fwdekker.com/FWDekker/dice/">git</a>.
|
||||
|
||||
<div style="float: right;">v1.0.8</div>
|
||||
</section>
|
||||
</footer>
|
||||
</main>
|
||||
|
@ -243,9 +248,9 @@
|
|||
const dieRollFreqs = rollFreqs.concat(repeat(0, die));
|
||||
rollFreqs = repeat(0, dieRollFreqs.length);
|
||||
|
||||
rangeInclusive(1, die).forEach(throwValue => {
|
||||
rangeInclusive(1, die).forEach(rollValue => {
|
||||
rangeExclusive(1, dieRollFreqs.length - die).forEach(i => {
|
||||
rollFreqs[throwValue + i] += dieRollFreqs[i];
|
||||
rollFreqs[rollValue + i] += dieRollFreqs[i];
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue