Сообщение от рони
|
Вариант...
var max = 16, arr = [];
max++;
while (--max) {
var i = arr.length;
var num = Math.floor(Math.random() * i);
arr.splice(num, 0, max);
}
alert(arr.join(",").match(/\d+,\d+/g).join("\n"))
|
var max = 16, arr = [];
max++;
while (--max) {
var i = arr.length;
var num = Math.floor(Math.random() * (i+/*!!!!!!!!*/1));
arr.splice(num, 0, max);
}
alert(arr.join(",").match(/\d+,\d+/g).join("\n"))