From 29691b4fe4994a6ba95d8ddfc52bae34fb48891b Mon Sep 17 00:00:00 2001 From: Jannis Date: Fri, 3 Feb 2023 11:24:48 +0100 Subject: [PATCH] Funktion feldFrei --- src/Umgebung | Bin 20088 -> 20232 bytes src/Umgebung.c | 10 ++++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Umgebung b/src/Umgebung index 50b19129a624179cda62aa2b6614e5a5eafcf301..63f6245fcfdff961e16e1fefe52fd1e27638b600 100755 GIT binary patch delta 2222 zcmZWqYitx%6ux(6@6JBkeRg--VxK|@r7V4y$94-{*aeE9lC%V+jcs9TL4jf_CT^vI zttD}n>yH-KLX3%0@ds|SM2WN|VlkmsO%Qy9_6G*v1uMZ28PA#7h6Hai=R1$@oO|wL zX70pk&mfH!(DB&9YleV@F)Tm}*B1G3xeTQn14n81UbM$`cJ*2t2c~5S? z;2(Rf<>g!d^u3TcBA#>9-s#;x+q-3^FEAT?YBJb6862GwgLE=TM^KJV3Blg6U|--) zkdE~QW`g~FnuCW%_Dg3d)c=*8!C9V2RJ->`A7q<^2+nGT$Nh&azY91HI0<+K@CIP# zpRybUY?_f}0wrz(W&;l2lx06)%`I7O1pE=O3()$PES~^u`CFDp04s0H@)TeXAQ7Mt z42KGY9(a^@=Q=%8FxPza)k+qGe0WOX*~w4mF7V9!F3XA=LohHKyS~A1=DKJD*XL!? z3BC~IGdu+HDi4F)!h1o6`ALv(@{4&{Ih$r>c@q{0q*x9MtIb+rtx3`mk_oOO&|z2N z=e+HD{_NsPp)x%&wD_bTOi28+kQVtG4vG;9Tv(qL#Jn0*VT5fePDm=E6m(J{loK@4 zQUt0SN2ef7BT(%ZipBOr%%)-C-5rp?>cKLEkRH$24g|x$$U2dZI*W9pLA752*ikp4 zI1Z1t2wjA|3IJ6e!z$}Rh?2b(Tm~70#$em4grx-#ahwI6T39`RUUc{YU^pcRu?y6M zZu1T_Tq5css8R%{B59eRYlD{ekg^;7%@ir~QAI`yaeV|JeMn9317d8|{g_(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RWG0*waMQtGq`JH7yG5 zN;ttO?8{zns#Ew|a{lT{-#_ktUzA<&&Q&<6!*U4T-fG87%j>Hv6>FJHwAA|JHBNBS cBfDEFe8GCh9g#yVmHw|+I9@lG3mRtp2mc#yyZ`_I diff --git a/src/Umgebung.c b/src/Umgebung.c index d04e5f7..472f855 100644 --- a/src/Umgebung.c +++ b/src/Umgebung.c @@ -140,8 +140,14 @@ void Apfel(int realU[N][N]){ } } } - - +//Die Funktion überprüft, ob das Feld bereits vom Schlangenkoerper besetzt ist. +int feldFrei(int realU1[N-1][N-1], int ii, int jj){ + if (realU1[ii][jj] == 0) + { + return 1; + } + return 0; +} int lose(int realU[N][N], int realU1[N-1][N-1], char richtung){ int groesste = 0; //Suche den Kopf der Schlange