<h1>Puzzle</h1>
<h2>Amount of digits needed to display all possible scores.</h2>
<ul>
<li><input type="number" value="6" id="number_of_teams" oninput="update_rules();"> teams.
<li>each playing <input type="number" value="7" id="number_of_rounds" oninput="update_rules();"> rounds.
<li>1 to <span class="number_of_teams">6</span> points are divided per round.
<br><small>(winner of a round gets <span class="number_of_teams">6</span> points, ..., last gets 1)</small>
</ul>
<p>
If at the end of every round you put up the score of each team, what are the max amount of digits you need?<br>
e.g. At some point each team has 11 points, that means you need 12 times the digit of 1.
</p>
<div class="links">
<a target="_blank" href="https://jsfiddle.net/ElMoonLite/bpmhfks1/show" title="Fullscreen result. Shareable link, available for everyone, with minor jsfiddle wrapper elements on screen.">fullscreen</a>
<a target="_blank" href="https://fiddle.jshell.net/ElMoonLite/bpmhfks1/show/?editor_console=" title="Fullscreen result. Only works when logged into jsfiddle. Shows only the result.">fullscreen 2</a>
</div>
<hr>
Run all rouns and show results:<br>
(start small, running above 10000x might take long or crash)<br>
<button onclick="reset();">reset</button><br>
<button onclick="run(1);">run 1x</button>
<button onclick="run(10);">run 10x</button>
<button onclick="run(100);">run 100x</button>
<button onclick="run(1000);">run 1000x</button>
<button onclick="run(10000);">run 10000x</button>
<button onclick="run(100000);">run 100000x</button>
<pre id="results"></pre>