diff --git a/bin/uebung10/logo/DarkForest.class b/bin/uebung10/logo/DarkForest.class index d7978e6..a82e59b 100644 Binary files a/bin/uebung10/logo/DarkForest.class and b/bin/uebung10/logo/DarkForest.class differ diff --git a/bin/uebung10/logo/Demo.class b/bin/uebung10/logo/Demo.class index 6616076..ba8e1bf 100644 Binary files a/bin/uebung10/logo/Demo.class and b/bin/uebung10/logo/Demo.class differ diff --git a/bin/uebung10/logo/Go.class b/bin/uebung10/logo/Go.class new file mode 100644 index 0000000..aecb3b4 Binary files /dev/null and b/bin/uebung10/logo/Go.class differ diff --git a/bin/uebung10/logo/HanselGretelFrame$1.class b/bin/uebung10/logo/HanselGretelFrame$1.class new file mode 100644 index 0000000..da983f8 Binary files /dev/null and b/bin/uebung10/logo/HanselGretelFrame$1.class differ diff --git a/bin/uebung10/logo/HanselGretelFrame.class b/bin/uebung10/logo/HanselGretelFrame.class index 98c39bf..ec40b4f 100644 Binary files a/bin/uebung10/logo/HanselGretelFrame.class and b/bin/uebung10/logo/HanselGretelFrame.class differ diff --git a/bin/uebung10/logo/HanselGretelVisitor.class b/bin/uebung10/logo/HanselGretelVisitor.class new file mode 100644 index 0000000..8d47158 Binary files /dev/null and b/bin/uebung10/logo/HanselGretelVisitor.class differ diff --git a/bin/uebung10/logo/PenDown.class b/bin/uebung10/logo/PenDown.class new file mode 100644 index 0000000..861c4e7 Binary files /dev/null and b/bin/uebung10/logo/PenDown.class differ diff --git a/bin/uebung10/logo/PenUp.class b/bin/uebung10/logo/PenUp.class new file mode 100644 index 0000000..f253e35 Binary files /dev/null and b/bin/uebung10/logo/PenUp.class differ diff --git a/bin/uebung10/logo/Sequence.class b/bin/uebung10/logo/Sequence.class new file mode 100644 index 0000000..211f8e2 Binary files /dev/null and b/bin/uebung10/logo/Sequence.class differ diff --git a/bin/uebung10/logo/Stmt.class b/bin/uebung10/logo/Stmt.class new file mode 100644 index 0000000..c6a8480 Binary files /dev/null and b/bin/uebung10/logo/Stmt.class differ diff --git a/bin/uebung10/logo/Turn.class b/bin/uebung10/logo/Turn.class new file mode 100644 index 0000000..0ba83d3 Binary files /dev/null and b/bin/uebung10/logo/Turn.class differ diff --git a/bin/uebung10/logo/Turtle.class b/bin/uebung10/logo/Turtle.class index c40331a..98b7ea2 100644 Binary files a/bin/uebung10/logo/Turtle.class and b/bin/uebung10/logo/Turtle.class differ diff --git a/bin/uebung10/logo/Visitor.class b/bin/uebung10/logo/Visitor.class new file mode 100644 index 0000000..3c2f4ef Binary files /dev/null and b/bin/uebung10/logo/Visitor.class differ diff --git a/src/uebung10/logo/DarkForest.java b/src/uebung10/logo/DarkForest.java index c8a660d..a233832 100644 --- a/src/uebung10/logo/DarkForest.java +++ b/src/uebung10/logo/DarkForest.java @@ -1,4 +1,4 @@ -package logo; +package uebung10.logo; public interface DarkForest { void breadCrumb(double x, double y); diff --git a/src/uebung10/logo/Demo.java b/src/uebung10/logo/Demo.java index 94740c7..abf6dd7 100644 --- a/src/uebung10/logo/Demo.java +++ b/src/uebung10/logo/Demo.java @@ -1,4 +1,4 @@ -package logo; +package uebung10.logo; public class Demo { public static void main(String[] args) { diff --git a/src/uebung10/logo/Go.java b/src/uebung10/logo/Go.java new file mode 100644 index 0000000..1f82e80 --- /dev/null +++ b/src/uebung10/logo/Go.java @@ -0,0 +1,19 @@ +package uebung10.logo; + +public class Go implements Stmt{ + + public final double dist; + + public Go(double dist) { + if (dist < 0) { + throw new IllegalArgumentException(); + } else { + this.dist = dist; + } + } + + @Override + public T accept(Visitor visitor) { + return visitor.visit(this); + } +} diff --git a/src/uebung10/logo/HanselGretelFrame.java b/src/uebung10/logo/HanselGretelFrame.java index 734f4df..a4962b5 100644 --- a/src/uebung10/logo/HanselGretelFrame.java +++ b/src/uebung10/logo/HanselGretelFrame.java @@ -1,4 +1,4 @@ -package logo; +package uebung10.logo; import javax.swing.JFrame; import javax.swing.JPanel; diff --git a/src/uebung10/logo/HanselGretelVisitor.java b/src/uebung10/logo/HanselGretelVisitor.java new file mode 100644 index 0000000..ab0c6b0 --- /dev/null +++ b/src/uebung10/logo/HanselGretelVisitor.java @@ -0,0 +1,18 @@ +package uebung10.logo; + +public class HanselGretelVisitor implements Visitor { + + private double gap; + private double s; + private Turtle turtle; + private DarkForest forest; + + public HanselGretelVisitor(double s, Turtle turtle, DarkForest forest) { + this.s = s; + this.turtle = turtle; + this.forest = forest; + } + + + +} diff --git a/src/uebung10/logo/PenDown.java b/src/uebung10/logo/PenDown.java new file mode 100644 index 0000000..beb75fa --- /dev/null +++ b/src/uebung10/logo/PenDown.java @@ -0,0 +1,9 @@ +package uebung10.logo; + +public class PenDown implements Stmt{ + + @Override + public T accept(Visitor visitor) { + return visitor.visit(this); + } +} diff --git a/src/uebung10/logo/PenUp.java b/src/uebung10/logo/PenUp.java new file mode 100644 index 0000000..d68d452 --- /dev/null +++ b/src/uebung10/logo/PenUp.java @@ -0,0 +1,9 @@ +package uebung10.logo; + +public class PenUp implements Stmt { + + @Override + public T accept(Visitor visitor) { + return visitor.visit(this); + } +} diff --git a/src/uebung10/logo/Sequence.java b/src/uebung10/logo/Sequence.java new file mode 100644 index 0000000..c367701 --- /dev/null +++ b/src/uebung10/logo/Sequence.java @@ -0,0 +1,15 @@ +package uebung10.logo; + +public class Sequence implements Stmt { + + public final Stmt[] seq; + + public Sequence(Stmt... seq) { + this.seq = seq; + } + + @Override + public T accept(Visitor visitor) { + return visitor.visit(this); + } +} diff --git a/src/uebung10/logo/Stmt.java b/src/uebung10/logo/Stmt.java new file mode 100644 index 0000000..4ecc46e --- /dev/null +++ b/src/uebung10/logo/Stmt.java @@ -0,0 +1,7 @@ +package uebung10.logo; + +public interface Stmt { + + public T accept(Visitor visitor); + +} diff --git a/src/uebung10/logo/Turn.java b/src/uebung10/logo/Turn.java new file mode 100644 index 0000000..e52e210 --- /dev/null +++ b/src/uebung10/logo/Turn.java @@ -0,0 +1,15 @@ +package uebung10.logo; + +public class Turn implements Stmt{ + + public final double angle; + + public Turn(double angle) { + this.angle = angle; + } + + @Override + public T accept(Visitor visitor) { + return visitor.visit(this); + } +} diff --git a/src/uebung10/logo/Turtle.java b/src/uebung10/logo/Turtle.java index 497bfd3..a0cd164 100644 --- a/src/uebung10/logo/Turtle.java +++ b/src/uebung10/logo/Turtle.java @@ -1,4 +1,4 @@ -package logo; +package uebung10.logo; public class Turtle { private double x; diff --git a/src/uebung10/logo/Visitor.java b/src/uebung10/logo/Visitor.java new file mode 100644 index 0000000..14d233c --- /dev/null +++ b/src/uebung10/logo/Visitor.java @@ -0,0 +1,11 @@ +package uebung10.logo; + +public interface Visitor { + + T visit(PenUp penUp); + T visit(PenDown penDown); + T visit(Turn turn); + T visit(Sequence sequence); + T visit(Go go); + +}