Skip to content

Instantly share code, notes, and snippets.

@thepauljones
Created March 4, 2016 09:22
Show Gist options
  • Save thepauljones/271159cb0ee364373e28 to your computer and use it in GitHub Desktop.
Save thepauljones/271159cb0ee364373e28 to your computer and use it in GitHub Desktop.
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 timtamsleftAfterEveryoneGetsOne = totalTimTamsinPack - people.length;
while(timtamsleftAfterEveryoneGetsOne-- > 0)
alert("The " + (timtamsleftAfterEveryoneGetsOne + 1 )+ "nd last tim tam goes to " + people[Math.floor(Math.random()*people.length)]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment