Compare commits

..

No commits in common. "7fea13b9b3878cb07a2ae3ed73131a610481be96" and "0c95c28bc4ad63961fa1344ba6267a7f560e44c2" have entirely different histories.

25 changed files with 4 additions and 107 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,4 +1,4 @@
package uebung10.logo; package logo;
public interface DarkForest { public interface DarkForest {
void breadCrumb(double x, double y); void breadCrumb(double x, double y);

View File

@ -1,4 +1,4 @@
package uebung10.logo; package logo;
public class Demo { public class Demo {
public static void main(String[] args) { public static void main(String[] args) {

View File

@ -1,19 +0,0 @@
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> T accept(Visitor<T> visitor) {
return visitor.visit(this);
}
}

View File

@ -1,4 +1,4 @@
package uebung10.logo; package logo;
import javax.swing.JFrame; import javax.swing.JFrame;
import javax.swing.JPanel; import javax.swing.JPanel;

View File

@ -1,18 +0,0 @@
package uebung10.logo;
public class HanselGretelVisitor implements Visitor<Turtle> {
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;
}
}

View File

@ -1,9 +0,0 @@
package uebung10.logo;
public class PenDown implements Stmt{
@Override
public <T> T accept(Visitor<T> visitor) {
return visitor.visit(this);
}
}

View File

@ -1,9 +0,0 @@
package uebung10.logo;
public class PenUp implements Stmt {
@Override
public <T> T accept(Visitor<T> visitor) {
return visitor.visit(this);
}
}

View File

@ -1,15 +0,0 @@
package uebung10.logo;
public class Sequence implements Stmt {
public final Stmt[] seq;
public Sequence(Stmt... seq) {
this.seq = seq;
}
@Override
public <T> T accept(Visitor<T> visitor) {
return visitor.visit(this);
}
}

View File

@ -1,7 +0,0 @@
package uebung10.logo;
public interface Stmt {
public <T> T accept(Visitor<T> visitor);
}

View File

@ -1,15 +0,0 @@
package uebung10.logo;
public class Turn implements Stmt{
public final double angle;
public Turn(double angle) {
this.angle = angle;
}
@Override
public <T> T accept(Visitor<T> visitor) {
return visitor.visit(this);
}
}

View File

@ -1,4 +1,4 @@
package uebung10.logo; package logo;
public class Turtle { public class Turtle {
private double x; private double x;

View File

@ -1,11 +0,0 @@
package uebung10.logo;
public interface Visitor<T> {
T visit(PenUp penUp);
T visit(PenDown penDown);
T visit(Turn turn);
T visit(Sequence sequence);
T visit(Go go);
}