From 13991b6bd2cb7fa239066828f6551bccfb9ee850 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Wed, 16 Nov 2022 21:57:47 +0100 Subject: [PATCH] Make connections in LabyrinthServer two-way --- app/src/main/java/ch/nuth/zhaw/exbox/LabyrinthServer.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/ch/nuth/zhaw/exbox/LabyrinthServer.java b/app/src/main/java/ch/nuth/zhaw/exbox/LabyrinthServer.java index bf92073..b4dc661 100644 --- a/app/src/main/java/ch/nuth/zhaw/exbox/LabyrinthServer.java +++ b/app/src/main/java/ch/nuth/zhaw/exbox/LabyrinthServer.java @@ -26,7 +26,10 @@ public class LabyrinthServer implements CommandExecutor { while ((currentLine = reader.readLine()) != null) { String[] elements = currentLine.split(" "); - graph.addEdge(elements[0], elements[1], 0); + + for (int i = 0; i <= 1; i++) { + graph.addEdge(elements[i], elements[1 - i], 0); + } } } } catch (Throwable e) {