diff --git a/func.js b/func.js index c440462..8056b3b 100644 --- a/func.js +++ b/func.js @@ -2,10 +2,11 @@ var prev_board = [] $(function () { - var init_board = [0, 2, 0, 0, 0, 0, -5, 0, -3, 0, 0, 0, 5, -5, 0, 0, 0, 3, 0, 5, 0, 0, 0, 0, -2, 0]; - var red = "#E83D04" - var white = "#E8E077" - var brown = "#4C2E00" + var init_board = [0, 2, 0, 0, 0, 0, -5, 0, -3, 0, 1, 0, 4, -5, 0, 0, 0, 3, 0, 5, 0, 0, 0, 0, -2, 0]; + // var init_board = [0,2,0,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] + const red = "#E83D04" + const white = "#E8E077" + const brown = "#4C2E00" var prev_board = [] var color = white; @@ -15,40 +16,40 @@ $(function () { for (var i = 0; i < 26; i++) { - if (i < 13 && 0 < i) { - var pos = 'bottom'; - } else if (i > 12 && i < 25) { - var pos = 'top'; - } else { - var pos = 'bar'; - } + if (i < 13 && 0 < i) { + var pos = 'bottom'; + } else if (i > 12 && i < 25) { + var pos = 'top'; + } else { + var pos = 'bar'; + } - if (color == white) { - color = red; - } else { - color = white; - } + if (color == white) { + color = red; + } else { + color = white; + } - if (i == 0 || i == 25) { - color = brown; + if (i == 0 || i == 25) { + color = brown; + } + + var div = $("
").addClass("pin").addClass("pin-"+pos).attr('id', 'pin-'+i); + + var checkers_div = $("
").addClass("checkers").attr('id', 'checkers-'+i); + var checkers_list = $("