From 7d56d30e196e593d79da4327fdba040ceb5b2d0a Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Tue, 18 Oct 2022 13:16:47 +0200 Subject: [PATCH] Improve readability of HilbertServer --- app/src/main/java/ch/nuth/zhaw/exbox/HilbertServer.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/main/java/ch/nuth/zhaw/exbox/HilbertServer.java b/app/src/main/java/ch/nuth/zhaw/exbox/HilbertServer.java index 7097855..eb2fb98 100644 --- a/app/src/main/java/ch/nuth/zhaw/exbox/HilbertServer.java +++ b/app/src/main/java/ch/nuth/zhaw/exbox/HilbertServer.java @@ -17,14 +17,18 @@ public class HilbertServer implements CommandExecutor { private void hilbert(Turtle turtle, int depth, double dist, double angle) { if (depth > 0) { turtle.turn(-angle); + hilbert(turtle, depth - 1, dist, -angle); turtle.move(dist); turtle.turn(angle); + hilbert(turtle, depth - 1, dist, angle); turtle.move(dist); + hilbert(turtle, depth - 1, dist, angle); turtle.turn(angle); turtle.move(dist); + hilbert(turtle, depth - 1, dist, -angle); turtle.turn(-angle); } else {