From 50c9e4844503221dad42a7ad4ee25b5ca10f88ac Mon Sep 17 00:00:00 2001 From: Jannis Date: Tue, 7 Feb 2023 23:11:09 +0100 Subject: [PATCH] Refactoring Funktion lose --- build/test/out/c/Spiellogik.o | Bin 6096 -> 6008 bytes build/test/out/test_Spiellogik.out | Bin 60504 -> 60536 bytes build/test/results/test_Spiellogik.pass | 2 +- build/test/results/test_Umgebung.pass | 2 +- build/test/results/test_test.pass | 2 +- src/Spiellogik.c | 39 +++++++++++++----------- 6 files changed, 24 insertions(+), 21 deletions(-) diff --git a/build/test/out/c/Spiellogik.o b/build/test/out/c/Spiellogik.o index a4a2861b37f64ff8dd961e7a26882ebab4e8bb65..a1351959b5ef90855912281b7a1e447da8b2d2a0 100644 GIT binary patch delta 1388 zcmZ`&U1$_n6uxI>?__6ZHaojBvt!ga1`{4|$Nb0ihLq=n_F6gGCASC6T1yizo>GRfrNwA8hHlGk5(7dSLcD=eyte z?%XqXr(6DMzO>eBPqBBA4YDkAnN!}80sI!Gwe!W z#%|NYo_EnNi4GU~aYkvZ+CED4zNO)ZwmF9KtIJ>1s>t`1Y04`w-JiIUT&VD_oy^| zw8<3T7&Zla<+-tY;pUYU>B(tGK2jo;6NEgbwPeD$^wD5)Fa4$#n35 znN3#azmi6rV!-ZV*=(EG75^3BF21gAtGP)FB53GLe5*#0Q2c>A6JCwDXd+_tX!I-- z1;tbBPk5cxQd{ZWDeHBM_&u^dD6!)9cWB1?aEA8!e$na+xjKPhc{TSwvpS0#EN|&! zxhg=Mg6=~Q|G~r|D=p4?Cb-2lQeNXxOL8FuoZD?C%6n@`(@7tugNp5nJ+%&aIlYXQdTieK_tqNOJLX)Ymij_J$=(G+8MRB&S zg1WJcK?$Xk1LCB03Y&C4{4vVL1ReVjoD4-ph9B(5CSp4`+;m7Bm3q#-Z)S<%@jWa}v|p;%)qakCioR^TqIZgPqUsmj5B;53B21F!$Ef=Ht$y+@D7L_CR*>m&rGl3Yn#?=NiD$l6)3=w5_}k z-qsrL>oW#1Q+aEYd8mZ93i3-bqBs_xc?{R7lGExRf?u_X4Laq~{&_pl2r-|VQUs-} zT1l~qA}D<3Xo+H#IRvw!k^A9O(ZYw|in!j>!8gWK{{#Ai`u%!aEEfuL)74w|dW?q{ z(>c$D$nYjvF4UKd@hU#8;y}0~hpHxWJJks>)nadq~5KHw+1H4fnwz zZ-20~{Rt#88D~?#eci)v%0tmGT8rP(vLoMCiMQJ4##nj&t5xFjJ-#{4r{J=`J9Yy3 zN$}_x(XSx``s`sWv11_Of`t^q-TOE+Vo0CD}&d z4ED;Gp;sk(9Bv|dz6yE~l7VRb&k`j?tH6unh%)~~z@oM82sUdwpC8=@h2VACrv$ua zHsV7$Xf|%4RZ*-Lzm>A!b-ZC2Bv$I+mVTYoDH)gBEu)NGvTrTC5DHsVQU#tf1EPx< zAn6KuF3GHf0`;M$hboPg^*J5VGL^=nXIVbh!*@vkv0p7?zcYB(jEjL1PVyZW%$ZQvIB)pK!A6lcDo3A9fsLw6|%QS5lw3 z!HlG0d(f{0`=CG4)^wl>dV)HktYc6giHn11+QTbX=rLM=TVH<^gR~U7HY;Vp1E!UV zoxvD2E{EOFZ?(05f=H!RCxQ;uu%ql%2jPgdHuygNxsfD@6eSFotxn~%7tH7e&mLKJ I!9J&d0lP6Z9{>OV diff --git a/build/test/out/test_Spiellogik.out b/build/test/out/test_Spiellogik.out index 48055f6b1b0d6d326a8af3c853dc9be6ac1fd9c7..740250bae201f102395f0f94b08775118046e09f 100755 GIT binary patch delta 1527 zcmY*XeN0nV6uDPj_x#HQPQh1iCSGgI&6wXL~!p!WewTw2?aWdB(9i9Z>H zb(!)ZV|O}4?;2N~Ix*q(R>8Gg6Qt$FMHuSqDO}Bs!(hqMhG9c}2_@t*eq?qxT2#O7 zbwgEd3hc;L(RA)v8iu{vx)YCM4Glk|P7&Wl55i&E8{_=|X} zLb|zwV90x(UeEoQhT&>S$+63PoN}nlD=x8aBgE0fmUBqC;n-R-w?xg4Z5oUR*I zI~wha7(U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|;u;E8!sLIvlYFh~y zEKXf8=IRP)_WB}8JJMoum?YOtmVc(ovA)=jsU?Oil8m*jj0RqQ@O0wmkJX7{Y~sjk z)K#gUGv+%F6SG=WAxsjkpAcg4^eK3}q^xrF62@Esp-O@53$Faip(e4HR$wDVlrC1% zzVlj_Uy4vTUkTf6*9!=s-_@tok=m9TYa$IPNxxuNf=f&1yTbXz7fwn;6IG>$J{B&zrVlc`#(+T zk1AdM+m!x0kJ7#&?K8pvX|tRviEdo)-F1`QX{S^ydRD3)G@Y#u#506 zVK3ppXfzroEO-!&MhN#2CdV`O72zVnON3Q~LxejC9}{*FTII^sxuSg?M}sA!`F*Y= zA&!5YGl*K2MyXPfvG1_E)&ZyRBH1}OT(TW(I|gc!(4K#EJ3>*_lF#Y?g^1Su^PV&Ilzd6 zp_x#PPeN;EtfhC-Z6#x8bQdp`ddJtisk|(mM)@5aft36*HJqXXEu;N~R{bFp_jF7J zGk(-Db@4+HO`SHcHpr17WqfT4HTZl(GDl9$7!9*xPMD=duIhC zVsEDxyt4D)OX8xrP?*9S7whx&dHSprx77lPVo~z06tFU;2XI>z$B@C?)_Hoy5=>05 zcT>hF`;R&;@F|`+sB=~5$SKD6O! zjYi(p=MiBeUcJ16KF5qJS<3AzuIvX74qj=8OnGzvYL0s-$rrB00i48(*UKRvEd$Td z^JEW{)3Y}W)N!{Yyf#n^>*W`JZUO3k=EiX|1aZxsc{ N || feldFrei(realU, ii, jj+1) == 1){ - return 1;break; - } - } + if (richtung == 'u') { + if (realU[ii - 1][jj] != (N*N) + 1&& realU[ii - 1][jj] != 0) { + return 1; + } + } + else if (richtung == 'd') { + if (realU[ii + 1][jj] != (N*N) + 1 && realU[ii + 1][jj] != 0 || ii == 20) { + return 1; + } + } + else if (richtung == 'l') { + if (realU[ii][jj-1] != (N*N) + 1 && realU[ii][jj-1] != 0 || jj == 0) { + return 1; + + } + } + else { + if (realU[ii][jj + 1] != (N*N) + 1 && realU[ii][jj + 1] != 0) { + return 1; + } + } return 0; }