Skip to content

Instantly share code, notes, and snippets.

View tecteun's full-sized avatar
💭
🤠

tecteun

💭
🤠
View GitHub Profile
@tecteun
tecteun / timtamlottery.js
Last active March 4, 2016 09:37 — forked from thepauljones/timtamlottery.js
Open sourced code to determine who in the team gets the overige tim tams after everyone has had one
var totalTimTamsinPack = 8; //For the Hellema brand
var people = ["fardau", "wilfred", "jeroen", "teun", "arjan", "erik", "paul"];
var usecrypto = true;
var timtamsleftAfterEveryoneGetsOne = totalTimTamsinPack - people.length;
var array = new Uint32Array(1);
while(timtamsleftAfterEveryoneGetsOne-- > 0){
var winer = null;
if(usecrypto){
window.crypto.getRandomValues(array);