Update 09/2019: For the slightly less nerdy or those who just want something a whole lot fancier with less effort required, Google has now integrated animated d4, d6, d8, d10, d12 & d20 dice rolling into their search.
For myself and others with a disproportionate amount of nerdy, a (hopefully) lightweight digital replacement for those bereft of dice. Using convenient (if not cross compatible) HTML references for UTF-8/Unicode Symbols and some simple PHP or JavaScript we can roll a randomized set of five six-sided die with each browser refresh.
First we build a HTML container for our die rolling script. While the CSS style adds unnecessary weight, it does allow for greater readability:
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<h1 style="font: 42pt/.8em sans-serif;"><!-- Insert PHP or Javascript Here --></h1>
</body>
</html>
A quick for loop and some (uncouth) shorthand allow us to push out five randomized UTF-8 symbols ranging between one and six. Should we desire more or less die in our roll, we simply adjust the loop accordingly:
<?php for ($x=0;$x<=4;$x++){ ?>ɨ<?= rand(0,5); ?><?php } ?>
Once again, a simple loop and random zero to five append in shorthand. This time via the JavaScript fuctions document.write(), math.floor(), and math.random():
<script language="javascript">
for ($x=0;$x<=4;$x++){
document.write('ɨ' + (Math.random() * 5 | 0));
}
</script>
Once we’ve pasted our script of choice, into our container we can minify the lot and upload someplace for all our tabletop gaming or dice rolling needs.