Skip to content

Instantly share code, notes, and snippets.

@halldorel
Created May 23, 2015 16:28
Show Gist options
  • Save halldorel/bb10d26212cc9e8b1d5c to your computer and use it in GitHub Desktop.
Save halldorel/bb10d26212cc9e8b1d5c to your computer and use it in GitHub Desktop.
Hvernig velja á herbergi
function shuffle(o){ for(var j, x, i = o.length; i; j = Math.floor(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x); return o; }
var couples = ["SM", "KÁ", "HH"];
var rooms = ["MB", "Hjónó", "Bónó"];
couples = shuffle(couples);
rooms = shuffle(rooms);
for (var i in couples) {
console.log(couples[i] + " gista í " + rooms[i] + " og hafa massa gaman");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment