Improve readability of HilbertServer

This commit is contained in:
Manuel Thalmann 2022-10-18 13:16:47 +02:00
parent aecc499585
commit 7d56d30e19

View file

@ -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 {