style fixes
Diff
src/App.js | 25 +++++++++++++------------
src/board.css | 2 +-
2 files changed, 12 insertions(+), 15 deletions(-)
@@ -1,4 +1,4 @@
import { INVALID_MOVE } from 'boardgame.io/core';
import { INVALID_MOVE } from "boardgame.io/core";
function IsVictory(cells) {
@@ -57,19 +57,17 @@
];
function validMove(cell, id, tile) {
const borders = [
0,1,2,3,4,7,8,11,12,13,14,15
];
const borders = [0, 1, 2, 3, 4, 7, 8, 11, 12, 13, 14, 15];
if (tile === null) {
return borders.includes(id)
return borders.includes(id);
}
return (cell[0] === tile[0] || cell[1] === tile[1]);
return cell[0] === tile[0] || cell[1] === tile[1];
}
function unclaimed(tile) {
return !(tile===0||tile===1);
return !(tile === 0 || tile === 1);
}
const Okiya = {
turn: {
@@ -96,8 +94,7 @@
if (unclaimed(G.cells[id]) && validMove(G.cells[id], id, G.lastPlayed)) {
G.lastPlayed = G.cells[id];
G.cells[id] = parseInt(ctx.currentPlayer, 10);
}
else {
} else {
return INVALID_MOVE;
}
},
@@ -108,8 +105,8 @@
return { winner: ctx.currentPlayer };
}
if(G.cells.filter(unclaimed).length === 0) {
return {draw: true}
if (G.cells.filter(unclaimed).length === 0) {
return { draw: true };
}
let numMoves = Okiya.ai.enumerate(G, ctx).length;
@@ -117,10 +114,10 @@
if (numMoves === 0) {
return {
winner: ctx.currentPlayer,
stalemate: true
}
stalemate: true,
};
}
},
};
export default Okiya;
export default Okiya;
@@ -52,4 +52,4 @@
}
.board td[data-tile^="D"] {
background-color: #e056fd;
}
}