我想通过仅使用JavaScript来查找可能的组合n数字从一大组选定的数字。javascript匹配任何数字被选中
这是代码,我发现在互联网上,但一些代码丢失:
var nd = true;
function no_dup(v) {
nd = !v;
genfunction();
}
function genfunction() {
var x = document.getElementsByClassName("choice");
var number_set = [];
var j = 0;
for (i = 0; i < x.length; i++)
if (x[i].checked) {
number_set[j++] = x[i].value;
........
........
........
// rest of the code is lost.
这是网页是什么样子:
所以,你正在寻找给定数字的所有可能的组合,同时保持'规则XY = YX'? –