2 Commits

Author SHA1 Message Date
f489c4c8ab remove useless class
All checks were successful
Linux arm64 / Build (push) Successful in 24m6s
2025-01-28 11:30:16 +01:00
c430a1e1b0 fix previous commit 2025-01-28 11:30:09 +01:00
3 changed files with 4 additions and 37 deletions

View File

@@ -1,28 +0,0 @@
package network.protocol;
import java.util.ArrayList;
import java.util.List;
public class PacketDispatcher {
private final List<PacketVisitor> handlers;
public PacketDispatcher() {
this.handlers = new ArrayList<>();
}
public void dispatch(Packet packet) {
for (PacketVisitor handler : handlers) {
handler.visitPacket(packet);
}
}
public void registerHandler(PacketVisitor handler) {
handlers.add(handler);
}
public void unregisterHandler(PacketVisitor handler) {
handlers.remove(handler);
}
}

View File

@@ -1,6 +0,0 @@
package network.protocol;
public class PacketFactory {
}

View File

@@ -2,6 +2,7 @@ package sudoku.solver;
import java.util.concurrent.CancellationException;
import sudoku.structure.Coordinate;
import sudoku.structure.MultiDoku;
import sudoku.structure.Sudoku;
@@ -23,9 +24,9 @@ public class StupidSolver {
if (!sudoku.getCell(index).isMutable())
return solve(sudoku, index + 1);
var coords = sudoku.toCoords(index);
Coordinate coords = sudoku.toCoords(index);
for (int symbol = 0; symbol < sudoku.getSize(); symbol++) {
if (sudoku.tryPlaceCellSymbol(coords[0], coords[1], symbol)) {
if (sudoku.tryPlaceCellSymbol(coords.getX(), coords.getY(), symbol)) {
// on tente de placer sur la case suivante
if (solve(sudoku, index + 1)) {
return true;
@@ -33,7 +34,7 @@ public class StupidSolver {
}
}
// on a tout essayé et rien n'a fonctionné
sudoku.clearCell(coords[0], coords[1]);
sudoku.clearCell(coords.getX(), coords.getY());
return false;
}