Created
April 27, 2021 15:19
-
-
Save knjname/9953347f79c0e1c5e0b172928f2d7d20 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const stats = [... new Array(1000)].map(it => 0); | |
const makeStat = () => { | |
let result = 0; | |
for (let i = 0; i < 1000; i++) { | |
result += Math.random(); | |
} | |
return result | |
} | |
for (let i = 0; i < 100000; i++) { | |
stats[Math.ceil(makeStat())]++; | |
} | |
for (let i = 0; i < stats.length; i++) { | |
if (stats[i]) | |
document.write(`<div style="width: ${stats[i] / 4}px;">${i}</div>`); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment