There is a code that creates lines of this type:
5 numbers space one additional number ( xxxxx x ) ,
and you need to do
5 numbers and 5 additional numbers ( xxxxx xxxxx x ) .
To consider as one combination a set from 5 basic numbers and 5 additional.
Basic numbers with an additional 1 combination 1 time can be repeated for a request. One combination with another combination for one request for any number of combinations should not be repeated.
function generate() { document.getElementById("myTable").innerHTML = ""; const numbers = (new Array(25)).fill(1).map((a, i) => a + i); let resultSet = new Map(); let qnt = parseInt(document.getElementById('quantity').value, 10); while (resultSet.size < qnt) { let nums = shuffle(numbers).slice(0, 5); let key = (nums.sort() + ''); resultSet.set(key, nums); } resultSet.forEach(val => { const main = createTableWithContent(val.join('-'), "one"); const additional = createTableWithContent(randInt(), "two"); main.append(additional); document.getElementById("myTable").append(main); }) } function shuffle(arr) { return arr.map(el => { return { item: el, sort: Math.random() } }).sort((a, b) => a.sort - b.sort).map(el => el.item); } function randInt(min = 1, max = 4) { return Math.floor(Math.random() * (max - min + 1)) + min; } function createTableWithContent(content, className) { const tableEl = document.createElement("TABLE"); tableEl.className = className || ""; tableEl.append(content); return tableEl; } <input id="quantity" type="text" placeholder="ΠΠΎΠ»-Π²ΠΎ ΠΊΠΎΠΌΠ±ΠΈΠ½Π°ΡΠΈΠΉ" style="background: #ffffff!important;color: #8f2d00!important;font-size: 20px!important;"/><input class="annoying-btn" type="button" value="ΠΠΎΠ»ΡΡΠΈΡΡ ΠΊΠΎΠΌΠ±ΠΈΠ½Π°ΡΠΈΠΈ" onclick="generate()" /> <div id="myTable"></div> How to make, that after a dash, 5 digits are also generated, and not one like now?
randIntsignature withrandInt(min = 10000, max = 99999)and you will have 5 digits - teran