diff --git a/src/code.js b/src/code.js index 0db1692..332de31 100644 --- a/src/code.js +++ b/src/code.js @@ -1,21 +1,26 @@ -var board = -[ +var board; + +function load() +{ + board = [ - [0, document.getElementById("id00")], - [0, document.getElementById("id01")], - [0, document.getElementById("id02")] - ], - [ - [0, document.getElementById("id10")], - [0, document.getElementById("id11")], - [0, document.getElementById("id12")] - ], - [ - [0, document.getElementById("id20")], - [0, document.getElementById("id21")], - [0, document.getElementById("id22")] - ] -]; + [ + [0, document.getElementById("id00")], + [0, document.getElementById("id01")], + [0, document.getElementById("id02")] + ], + [ + [0, document.getElementById("id10")], + [0, document.getElementById("id11")], + [0, document.getElementById("id12")] + ], + [ + [0, document.getElementById("id20")], + [0, document.getElementById("id21")], + [0, document.getElementById("id22")] + ] + ]; +} var ids = { @@ -49,5 +54,5 @@ function move(id) charater = "O" } - board[ids[id] [0]] [ids[id] [1]] [1].innerHTML = charater; + board[ids[id][0]][ids[id][1]][1].innerHTML = charater; } \ No newline at end of file diff --git a/src/index.html b/src/index.html index b345742..c905328 100644 --- a/src/index.html +++ b/src/index.html @@ -11,7 +11,7 @@