(from, to)
| 97 | return { str: `${a} ${operators[op]} ${b}`, mode, time, result }; |
| 98 | } |
| 99 | function randomInt(from, to) { |
| 100 | if (from > to) |
| 101 | [from, to] = [to, from]; |
| 102 | return Math.floor(Math.random() * (Math.floor(to) - Math.ceil(from) + 1) + Math.ceil(from)); |
| 103 | } |
| 104 | function pickRandom(list) { |
| 105 | return list[Math.floor(Math.random() * list.length)]; |
| 106 | } |