Add load/save functions

This commit is contained in:
Dorian HAMDANI
2025-03-31 14:00:00 +02:00
parent 001f572858
commit 7f530d4f60
3 changed files with 145 additions and 8 deletions

View File

@@ -95,7 +95,9 @@ public class GomokuBoard{
public GomokuCell get(int x, int y){
int i = 0, j = 0;
GomokuCell act = this.firstCell;
while (i != x && j != y){
// System.out.println("x: "+x+" y: "+y);
while (i != x || j != y){
// System.out.println("i: "+i+" j: "+j);
Cardinal c = Cardinal.SE;
if (i < x) i++;
else c = Cardinal.E;
@@ -191,7 +193,7 @@ public class GomokuBoard{
public String toString() {
StringBuilder out = new StringBuilder();
GomokuCell[][] cells = this.getAllsCells();
for (GomokuCell[] line : cells) {
for (GomokuCell[] line : cells) {
for (GomokuCell c : line) {
out.append(c.toString());
}