Improve readability of HilbertServer
This commit is contained in:
parent
aecc499585
commit
7d56d30e19
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue