From 639da57def3b4531d235c39969ebbc26c83c33e9 Mon Sep 17 00:00:00 2001 From: peet Date: Mon, 17 Jun 2024 22:33:01 +0200 Subject: [PATCH] MINAS --- bin/uebung10/logo/DarkForest.class | Bin 447 -> 144 bytes bin/uebung10/logo/Demo.class | Bin 2990 -> 1684 bytes bin/uebung10/logo/Go.class | Bin 0 -> 849 bytes bin/uebung10/logo/HanselGretelFrame$1.class | Bin 0 -> 1911 bytes bin/uebung10/logo/HanselGretelFrame.class | Bin 870 -> 1718 bytes bin/uebung10/logo/HanselGretelVisitor.class | Bin 0 -> 1952 bytes bin/uebung10/logo/PenDown.class | Bin 0 -> 708 bytes bin/uebung10/logo/PenUp.class | Bin 0 -> 700 bytes bin/uebung10/logo/Sequence.class | Bin 0 -> 401 bytes bin/uebung10/logo/Stmt.class | Bin 0 -> 244 bytes bin/uebung10/logo/Turn.class | Bin 0 -> 351 bytes bin/uebung10/logo/Turtle.class | Bin 907 -> 961 bytes bin/uebung10/logo/Visitor.class | Bin 0 -> 627 bytes src/uebung10/logo/DarkForest.java | 2 +- src/uebung10/logo/Demo.java | 2 +- src/uebung10/logo/Go.java | 19 +++++++++++++++++++ src/uebung10/logo/HanselGretelFrame.java | 2 +- src/uebung10/logo/HanselGretelVisitor.java | 18 ++++++++++++++++++ src/uebung10/logo/PenDown.java | 9 +++++++++ src/uebung10/logo/PenUp.java | 9 +++++++++ src/uebung10/logo/Sequence.java | 15 +++++++++++++++ src/uebung10/logo/Stmt.java | 7 +++++++ src/uebung10/logo/Turn.java | 15 +++++++++++++++ src/uebung10/logo/Turtle.java | 2 +- src/uebung10/logo/Visitor.java | 11 +++++++++++ 25 files changed, 107 insertions(+), 4 deletions(-) create mode 100644 bin/uebung10/logo/Go.class create mode 100644 bin/uebung10/logo/HanselGretelFrame$1.class create mode 100644 bin/uebung10/logo/HanselGretelVisitor.class create mode 100644 bin/uebung10/logo/PenDown.class create mode 100644 bin/uebung10/logo/PenUp.class create mode 100644 bin/uebung10/logo/Sequence.class create mode 100644 bin/uebung10/logo/Stmt.class create mode 100644 bin/uebung10/logo/Turn.class create mode 100644 bin/uebung10/logo/Visitor.class create mode 100644 src/uebung10/logo/Go.java create mode 100644 src/uebung10/logo/HanselGretelVisitor.java create mode 100644 src/uebung10/logo/PenDown.java create mode 100644 src/uebung10/logo/PenUp.java create mode 100644 src/uebung10/logo/Sequence.java create mode 100644 src/uebung10/logo/Stmt.java create mode 100644 src/uebung10/logo/Turn.java create mode 100644 src/uebung10/logo/Visitor.java diff --git a/bin/uebung10/logo/DarkForest.class b/bin/uebung10/logo/DarkForest.class index d7978e68f7f001a7cb0493638a9205be427671a4..a82e59b006242f1e932e705b422f72e515f0e431 100644 GIT binary patch delta 42 vcmdnbJb{tx)W2Q(7#J8F88|0$nN2olv=wG#VPs%sU;_#=GOzax5-L^EnCSIHX|^#QR1vgRWJ@AJWEwri zD@F|he@F$F+}t5J=v^)lR7Wad9yAbyd-_3ZrF}R=pr55ZPKhl`FjZO31uF<&yAFe-?)Oit*UqzreRPZuYOZLm}ZXT;DYHWp>Cxi$HZ{=K1J_5=a=aMXlj z2ocnWJK0Wey4RZ-&1HJ)^usBa?6JsVrsu>OA!tt(C1OD|cl9m|V$Dc0(iTKe>y5{* zH<+nHQ#RqQE!@wp?{2Ciup_dg2B=t}8q{s=+3ISS1|Q(Rw1YQjew9qi?v4SwPRhi6 MK^soX<^TWy diff --git a/bin/uebung10/logo/Demo.class b/bin/uebung10/logo/Demo.class index 66160764f25d2c5c09a31f007c2a2eb0a5cf0969..ba8e1bf2f87d0e46a52e78cc6703cff437205218 100644 GIT binary patch literal 1684 zcmb7E-E!Mh5dMy1OSa-9B1xO3Eh#BK!m>-V51`1+;ZP@Z$}EiONbtAb%(PS{j%@ zsf+?Nftk7=$n9=tPewc5URyGFJ#2dIh8OutA6(|+=l+4feEoRl8l!eRKM*)wd0IbW z;KY$1v}!929k0=r1v>KEt_+$|$K0`UoVXL~I3;i@i+L;qJNzy%FprXsGb}f2-wHKr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;=r@B63#1znuHY(*xW=)8?Wu@Ejx<4Tul@zs4SeKy)-=m_ fu=GWf+`lF{+`(P0-(!R`#p%p0M}#Wp4AlMrQqsAc literal 0 HcmV?d00001 diff --git a/bin/uebung10/logo/HanselGretelFrame$1.class b/bin/uebung10/logo/HanselGretelFrame$1.class new file mode 100644 index 0000000000000000000000000000000000000000..da983f84dc115f36120993d571a7148159d8b5ea GIT binary patch literal 1911 zcmah~O;a035PbuJHS!oRUp65aFf!&V77&uy$Z;Yh0Wy-XC7}f8gACGGT3B|K-Ic+2 zUvkPJIr$Id9Lj-8QkC*K|0I7RPR~k6qEsnVwX?G`-ThwoylMUY?;n2w2;*2o8^c6J z?p4g<;zH1{idJw#n2t2oZRtv5%@&6;u&BYu(6=vMh~uDhq?^Uy<0rzD21BP?(w)Ep z1xZ{IB}B##byIgAF$AVBwVuf__##$8c7fq4M+Z9nXvZ}U4c!dw)5@SHp_?*QIoy+W zR_qy)NG7bjFml4y)pu>tr${nPUIrRiB$C}_p_^{RIxJhJG+l4eHWD309Vx-H5j zJ@15OavFvh`dfCEqKf8Cj(!Yu;XS;sVT9pE-7YQ7g0!iG8-(I;jN%qU?`CXgH=N4G z!-;q}6Hl!(j5a_ox&$`m%aDpZ&M|@8lyWYd*p4;acehfi4j!T*=&ZK(_GR7;`7ww9 z#~n-&pd;N2VHuX1(!8+cc!;g>W^#(fG{=le;hIVz9ZN-HY2vST<~ZgRzkw>h>fY|t zZOSpb(}jCj&=910*Gm(z49n(N#1cctY9bujB%+Nnc-vkU%N!r!V}>h~g||uv(Zs%L zsOa6tiiQUaW0z=?BZP;fx9mooYInVXnQ?9FKzg8$I6lMY3|$0TU8dBUP-~`27^~;P zsJOZj4BNJNna~|q@riQ8utrd2;g;&@d3MT#kiytd8jmv!*P?s7l$1fIs9Pp!Pg!kp zB#@*c=&rPdYuQSvGga!IN4&Nkx{574)$pWtg@YG%Inu}wA5$Ka)(6fbGz&+=cJnc1 zN}?>4n7-in5pSgxZGB*$|P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fhI>;`}G)(YMdXX8;GN-O(%=ruG9Fm=-~mSQiMV^seZfkh@>PkoJSBQeD#N>XlF)BTU%dH(~t`LUWuj^Mk0^AqUkje)wJS diff --git a/bin/uebung10/logo/HanselGretelVisitor.class b/bin/uebung10/logo/HanselGretelVisitor.class new file mode 100644 index 0000000000000000000000000000000000000000..8d4715895923e4612913cd2b2f3525700c4694cf GIT binary patch literal 1952 zcmd5-T~8B16g|@x+Ac*90Rg`jP-!brP}IZ{5@H1(8Z{|2@o`(mc5rv6PG>Rx0i)4B z;{zelMBn{U#yd+1u-W>G4?B0}&bfEaxs$p3`_K2E05!K^PRB5CbM)#cqr{p?*tMsz5&zm}pL57L*!My;6WXtI=unK)$hCv-D z?Q(|6>UsQ5=r0rEja0m=8D=7gilg3cg?k3IE_|Uk7}oNY2(FhY;yn{xs57LV$~|r& ziLo3m;R?~r7wTD%j2yDanAz1FEDV|1bPhQTGmKP)&tC*ygR32j>A;Li%<`Nn+?dv90V*o7?(BhublXY%l0)TX-G9a$nn;u)=S1B{U^;8eOfN zrnWt<+j7tDUGn-dtBvJQOFm>?uq@cPW2$?Xs+zB!lC5ba{8rgqLn%geMZWj@>CT|Q z@a4adXlNEJhQ+7^D#kzfFEV_(c>ac?A-@tOU*qor?l*b=3n(#sy?6m9JdKEARK&LI zPyar{$BU=GEe&z2CIi*vTf(%GshHQeY#t3mwkBG>qXR{-%`*?_xcinPE#l-+M%>45 zw7gNqEVZ;GeFI1#fiyDo3rLu*7h39hp{0&Tc93wFFhb)ftvrewAUjb!!sX(^A;ybK zhnOr*rw%doEexBXaWVv1lzxcPniepOaT>4DUXi?%0M~JYteKgESvWICC&QUJJT=O2 z6SsOt&(ThT_N*VUUyscl;r1_D(O-f_LlQ`a_=Q+}zAwHQi@(l?rgP8CQD#efe2$GW`GY}azNNABFYFOGr)!`9H48k%i5 zmi90ha?@9kVkj&Ybp4UfkZK7>_-zKcTI(|;ZrvxIg^ZjE1!;!7E*#zoMg#8kjDgLG zMt4oa?i-#6<2ae{pT&fstS|P6MK!69VVZnQ4I9-ZOkYfd?|RLezO0(cGF@Rgh97v; z_^Q>rUd6Qk;cNAJ&33a!Hish03Q8+0i#w~>!#+cD8VXq>a6ZIZfl5^6daJX~=VB-= zZtQhD-&$q;DrV9dvRyauOnxuIwX3m=^KeTz1Kk*XNqP_xdAcjI8HzOWjC`{Gf$V$q zTP2%{k}@{vtj++~M4lpgF4!iLLWJFkNIDct6sH^YPwYx~qq9tPa~>t)Da|l3520~@ VL*lCtZq_5r98rehm~s+M{s7JBqcZ>i literal 0 HcmV?d00001 diff --git a/bin/uebung10/logo/PenUp.class b/bin/uebung10/logo/PenUp.class new file mode 100644 index 0000000000000000000000000000000000000000..f253e35ec200af646e1e5b3c4f6a6aa0c8ebec47 GIT binary patch literal 700 zcmZ`%%TB^T6g^WO1m2MnoMXoNvsC5(@-)}9>oxE@1w!>Jf5 z%hP(DEGAZ4-x3>V$o1X8Gx@y;N1lsJT!a(CIq0tFOVLA+Xr)`Cn59gkmC>4Nd?5E8 z{Z=TZqhbPEv{zyPwo#yr9tw7eq!?jK5lN47iSkUd@rgYNZ?sQP--1Vucq%bw&O>M% V;)wWago`!8$}v?KPN*i~^bffVpWgrg literal 0 HcmV?d00001 diff --git a/bin/uebung10/logo/Sequence.class b/bin/uebung10/logo/Sequence.class new file mode 100644 index 0000000000000000000000000000000000000000..211f8e26ff4e6bee2f140d12edd3389ede75a21a GIT binary patch literal 401 zcmZut%T9wp6g>l21Zk_)qFZ-uO~kG>CdQ;IqKg_ft_GaoG!#+_?)@Yejfo3Cz>hK> zv~H@oxtW}qdmeW_KHuH}T;b4$A>h|4uJd$!7Gy-<-$bUgM$tw2gAq# zQ+TkkEzk{hu5RjitjaqXXNpO}B9U1nOWol0rByxZC7m{ttQTV%cUshCq9(f0X#Z|} z+AND>8k+1a_Fm)5uM&7>BA4e5(F6tya7VB3MkgzDUx*A&108ZfmPMY!>Jj-r)7ZxW O5qaOLf@*yt1O6BD;#4RA literal 0 HcmV?d00001 diff --git a/bin/uebung10/logo/Stmt.class b/bin/uebung10/logo/Stmt.class new file mode 100644 index 0000000000000000000000000000000000000000..c6a8480e3594e9bf6ca64d9f45cd114954214762 GIT binary patch literal 244 zcmX^0Z`VEs1_nn4ZgvJHMh2nM)TGk9bVCFEoc#2B{os<^5_Sd_Mh1bb#Ii*FoW#6z zegCAa)Z`LI2DZfHm(1)C1YY#>l|Pzzp;c0|O(_)vOF` RKt4N=$Hc$^WO0I7TmbGbKzRTF literal 0 HcmV?d00001 diff --git a/bin/uebung10/logo/Turn.class b/bin/uebung10/logo/Turn.class new file mode 100644 index 0000000000000000000000000000000000000000..0ba83d3729448d7cd0976362c70227216e6768bc GIT binary patch literal 351 zcmZ{fF;BxV5QX2-P!nhYRj>dnQX+=X35i6J5FH~JYGrqV6Vs5 zBbGbe>AUydeSLp?0(ihR!yaMgW#e@>zs-8nnT&g@86v{zO1z7#7rM)yo0V)G!+1b1 z-P#fM1Jp|bEePX6Y2`{nlq}LZv`6zI4>7`Yf*8kyQIgg%g8l>y2ZWPKY5C;WjkH`e zTbWs9TG7|Ss_p!@jNGf*5YDP$+&s97wv}%o%1yEZ)M}%gv3XkU{u9pPrRubB-UipZ bg5M9B@*ll|^SsQ{P>*ndD~3zL`ERrzRYqVc literal 0 HcmV?d00001 diff --git a/bin/uebung10/logo/Turtle.class b/bin/uebung10/logo/Turtle.class index c40331a94f343a86497c0919be6ab52ff6e736b5..98b7ea26e05c1b9858e4253846737bb008f364da 100644 GIT binary patch literal 961 zcmZuvU2oGs5S+7_HgGciH7gCMW)giED#+>`#Y&5^}yg%%x}HOrSMb z*Y*q24rKaCDN>u9oC*|aJ6bfGOS2@Ri>_+an8+ZJlK8YBHt`s{26hB0HxGa7r)L(P zU{9cw#vlAi=toq}_&x)=7J7WCkK-BVPc1xC`7C6aNjM|d^u(VCm>=UT8OzrpzpcFR zd7qWgAwzT;i4KkZp-5wQ)K1>eUZ9E+Oj^s7T~eh%d(-_1%XQ|k-QFBkcQZdn{fB}z zX>Ac1$lM%38C)T70~VbFE}aqqHn2%MM=UH<#M0bOlLtfR0{3u#DeX~fT$OjPV1K7T zqq0SRfUT&lMZuC<;K5pO^)|S^7QD3%T60H6o!8fA(tT#nnGwP7bmN*A+6L^sVX6+T}ADJ6qThju_mUD9XTFEpR7_V z!M+bw^~?lB7E_@te0*&G=Q|hw`TOe@z$rQv1PoiL9Hu6D^SY;PVta$sc`Yj_F>GFm zYthrfB)u=gD;awRc0((o^@CxR9<*dAzgI^259D;CC_1`eD4p36A=VihkBE=XSyx4a z!F@GO&aA$cBOcqyRB7RrHGJyqP|L|X9@Yk9$wxBQ!jWbw;_o7nypt8!;Ug<&+*r>i z!pCFoNh)uqRNkWWp{e6MCJa%>vpQ;MGHiGIk5!#}r%ZB^Ro&<-BR{8;p>zX5g)lVx zHWvCqIF+66FH3%`W(=+VLyE<@olx_M^xqg(x<^qJyA16oyPd~eGE^z_bUxIQPo1HM zZa&Z;u?*q4O6?UH-2LCE{}OmHdBJu7TJ34huB6dzuUo!1wy8q6J8b&HVO%^mLN0>342QrT7`st a94vH^&F%kP>=qIZmmnMz5;$cI(EbOA@15`f diff --git a/bin/uebung10/logo/Visitor.class b/bin/uebung10/logo/Visitor.class new file mode 100644 index 0000000000000000000000000000000000000000..3c2f4efa339e6c5c97eb1b28635b01b7aa7d12c0 GIT binary patch literal 627 zcmZ{i%}T>S6ot=iO=D}-`iCgGl@!Ia+g1vK=%%2M=spcYNC`6C45j{(yqOzZL`d)#-Yw@ zOlS5gYi_DpAU?E^v9Mq2vcAr`t7`tF?4na!krkal={y#XX=dKDyWZFB>fH(6T{zlY x!DREOMIbcIHvk;7X$LLCuAv6DncF3In0HFumr literal 0 HcmV?d00001 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); + +}