From 0504c5affb46ba0664d57fc9be064386ae54da36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20GUEZO?= Date: Thu, 30 Oct 2025 19:51:02 +0100 Subject: [PATCH] fix: correction map.length -> map[0].length --- src/Map.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Map.java b/src/Map.java index a407a37..527b2c2 100644 --- a/src/Map.java +++ b/src/Map.java @@ -53,9 +53,9 @@ public class Map * Crée une map à partir d'un tableau d'entiers. * * @@ -66,9 +66,9 @@ public class Map { return create((i) -> switch (i) { case 0 -> new Circuit(CircuitCell.EMPTY); - case 1 -> new Circuit(CircuitCell.ROAD); - case 2 -> new Circuit(CircuitCell.START); - case 3 -> new Circuit(CircuitCell.FINISH); + case -1 -> new Circuit(CircuitCell.ROAD); + case -2 -> new Circuit(CircuitCell.START); + case -3 -> new Circuit(CircuitCell.FINISH); default -> new Circuit(CircuitCell.YROAD, i); }, map); } @@ -148,7 +148,7 @@ public class Map for (int i = 0; i < map.length; i++) { - for (int j = 0; j < map.length; j++) + for (int j = 0; j < map[0].length; j++) { switch (map[i][j].getType()) {