diff --git a/src/GomokuBoard.java b/src/GomokuBoard.java index 7387adc..3724663 100644 --- a/src/GomokuBoard.java +++ b/src/GomokuBoard.java @@ -3,4 +3,25 @@ public class GomokuBoard { private GomokuCell firstCell; private int boardWith; private int bordHeight; + + public GomokuBoard(int width, int height){ + this.firstCell = new GomokuCell(Color.NIL); + this.boardWith = width; + this.bordHeight = height; + } + + public GomokuCell get(int x, int y){ + int i = 0, j = 0; + GomokuCell act = this.firstCell; + while (i != x && j != y){ + Cardinal c = Cardinal.SE; + if (i < x) i++; + else c = Cardinal.E; + if (j < y) j++; + else c = Cardinal.S; + act = act.getNeighbour(c); + } + return act; + + } }