adjusted ids

This commit is contained in:
AUnicornWithNoLife 2021-04-11 17:42:02 +01:00
parent 4fb9f47205
commit 1cc661be2d
2 changed files with 20 additions and 18 deletions

View File

@ -1,19 +1,19 @@
var board =
[
[
[0, document.getElementById("00")],
[0, document.getElementById("01")],
[0, document.getElementById("02")]
[0, document.getElementById("id00")],
[0, document.getElementById("id01")],
[0, document.getElementById("id02")]
],
[
[0, document.getElementById("10")],
[0, document.getElementById("11")],
[0, document.getElementById("12")]
[0, document.getElementById("id10")],
[0, document.getElementById("id11")],
[0, document.getElementById("id12")]
],
[
[0, document.getElementById("20")],
[0, document.getElementById("21")],
[0, document.getElementById("22")]
[0, document.getElementById("id20")],
[0, document.getElementById("id21")],
[0, document.getElementById("id22")]
]
];
@ -36,6 +36,8 @@ var ptm = 1;
function move(id)
{
console.log(board[ids[id] [0]] [ids[id] [1]]);
var charater = "";
if (ptm === 1)

View File

@ -14,19 +14,19 @@
<body>
<table id='board'>
<tr>
<th><button onmousedown="move('00');" id='00'></button></th>
<th><button onmousedown="move('01');" id='01'></button></th>
<th><button onmousedown="move('02');" id='02'></button></th>
<th><button onmousedown="move('00');" id='id00'></button></th>
<th><button onmousedown="move('01');" id='id01'></button></th>
<th><button onmousedown="move('02');" id='id02'></button></th>
</tr>
<tr>
<th><button onmousedown="move('10');" id='10'></button></th>
<th><button onmousedown="move('11');" id='11'></button></th>
<th><button onmousedown="move('12');" id='12'></button></th>
<th><button onmousedown="move('10');" id='id10'></button></th>
<th><button onmousedown="move('11');" id='id11'></button></th>
<th><button onmousedown="move('12');" id='id12'></button></th>
</tr>
<tr>
<th><button onmousedown="move('20');" id='20'></button></th>
<th><button onmousedown="move('21');" id='21'></button></th>
<th><button onmousedown="move('22');" id='22'></button></th>
<th><button onmousedown="move('20');" id='id20'></button></th>
<th><button onmousedown="move('21');" id='id21'></button></th>
<th><button onmousedown="move('22');" id='id22'></button></th>
</tr>
</table>
</body>