March 2009
1 post
Antal kombinationer av ord
// shorthand function
function $(id) {
return document.getElementById(id);
}
// sorter for a list containing tuples
function tupleSort(a,b) {
if (a[0] < b[0])
return -1;
else if(a[0] > b[0])
return 1;
else
return 0;
}
// return an array containing tuples of doubled letters and number of occurences
function getDoubles(txt) {
var list = txt.split("");
var ret = new Array();
while...