Skip to content

Instantly share code, notes, and snippets.

@Nixinova
Created November 16, 2023 03:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Nixinova/d7dd84418332554b1cb0ac6ff4499891 to your computer and use it in GitHub Desktop.
Save Nixinova/d7dd84418332554b1cb0ac6ff4499891 to your computer and use it in GitHub Desktop.
Example Random Version History Generator
<html>
<head>
<title>Random Version History</title>
<script>
function randverhist() {
const vers = [];
const endchance = 0.1;
for (let x = Math.round(Math.random()); x < Math.random() * 10; x++) {
for (let y = 0; y < Math.random() * 10; y++) {
for (let z = 0; z < Math.random() * 10; z++) {
vers.push(`${x}.${y}.${z}`);
if (Math.random() < endchance) break;
}
if (Math.random() < endchance) break;
}
if (Math.random() < endchance) break;
}
output.innerHTML = vers.join('<br>');
}
</script>
</head>
<body>
<h1>Random Version History</h1>
<button onclick="randverhist();">Reroll</button>
<br>
<output id="output"></output>
<script>randverhist();</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment