File size: 937 Bytes
a0040c1
 
 
 
 
 
 
8b94c2a
a0040c1
8b94c2a
a0040c1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
const rows = 8;
const cols = 8;
const baseUrl = 'https://t1ckbase-minesweeper.hf.space';

const html = '<table id="toc">\n' +
  '  <tr>\n' +
  '    <td align="center">\n' +
  `      <img src="${baseUrl}/mines/count" height="48px" align="left" />\n` +
  `      <a href="${baseUrl}/game/reset"><img src="${baseUrl}/game/status" width="48px" height="48px" /></a>\n` +
  `      <img src="${baseUrl}/timer" height="48px" align="right" />\n` +
  '    </td>\n' +
  '  </tr>\n' +
  Array.from({ length: rows }, (_, r) =>
    '  <tr>\n' +
    '    <td align="center">\n' +
    Array.from({ length: cols }, (_, c) => {
      const imageUrl = `${baseUrl}/cell/${r}/${c}/image`;
      const clickUrl = `${baseUrl}/cell/${r}/${c}/click`;
      return `      <a href="${clickUrl}"><img src="${imageUrl}" width="32px" height="32px" /></a>`;
    }).join('\n') + '\n' +
    '    </td>\n' +
    '  </tr>').join('\n') +
  '\n</table>';

console.log(html);