From 4ef37f5b198e3ae8cf42ecd3eb57f7ea64f242a8 Mon Sep 17 00:00:00 2001 From: Daniel M Date: Mon, 5 Feb 2024 16:37:31 +0100 Subject: [PATCH] Minen werden verteilt --- duellist-spielesammlung-projekt.exe | Bin 43153 -> 43918 bytes .../src/duellist-spielesammlung-projekt.c | 15 +++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/duellist-spielesammlung-projekt.exe b/duellist-spielesammlung-projekt.exe index a54a068c8a4ee2c0d3c38938eab03ba12786c511..548d07a7dcb6f19884de1909adf02aaefac0b099 100644 GIT binary patch delta 7382 zcmcgweO#1PzCY)g8Q#GGMn&En89t50+Pyq|mK^E>A`-}C*w zocHIMwm(bT{zGbQjE!Sw%Gg@QdO2g)Ss)MPQasCHj1{--%~O1Km$h9RC20d_gW^Hb z^BC3m4UF}*jfkWEbwT_nZQwm2+5ph&Awe`tN~ir&G_^{D`7AmhjpTFaPsr!dZD}MK z6dKA^X!z4qq!`I-sY-E9VwseuoXy{)CS_inDT6V~9lrXHJ(H7_2#ED4lY>y$7iG{j zWsWo|gThrs;h(2FThPGl?@@^=fgh)5RdIY5?Nm)Q#|R^RO1n0gu{}Y0J+ms4?Yc;C zt5iU=)q2*@X`0xaaAJd=y%Ht}@YXy@EqE4~c2Znej=)yRv0{NO0%m^}S@U401-1Q5 z1l->2w+B8Df~LxJdNLqZJwwTuwafkhh}QUI`vqzbm^4I%nx%VuSF5Ej9vu|@bPV1{ zUk3~~>_bTQUH^1AT1=^|<Yb>!dedC%|IC|h=~KfLD~9?NdMq#| zd)H{^D7;dM?uyZjMw1A^g$G&B32>Af+&r3g1m;MKN7Dy^u~PnM`XX>8|B~hf%}0JH zD2tz<&w`ekEq!Ui36lK+LKEZg7nIEgjny#FJIg+R%8Ng&53|ngx7%IMYU|v-Wbg>=A zTMTwFM}T$-r~(k4JH+#9XY!uVQ33-E+Ipoa|uEJ zgqUboS8n!OlKZsw_plxjbBXZ%6nwW#PL97fXaiY8GA87pr8mcJfr;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$~a9s)1pB7Yf)TG)kO}{YsPL$jHSpOqym1)PsO9AW4_AmX1~I3C<7 zC;=i`Uei@T>@uxJAbJ^M_7B0#$YN}x@NS)H7pU_+)bceoE9xq1*%41zxD7k=bi;$d zH#-b1?=P4@jskh!V@DuofQZK%r~}BLEQU#@07NQ-Vt|Nk=vBKPi2M|p?c^9naTWs+ z=ciX|C6HUPfYv#+Msr>W$n@?Y*9z+e=^c++dF5mEjrhO_m4$eW);yy#eF$c&hbe-# z1BpWI-IMj0@+X6OJAJwo&zB5wd` zNFA+pT5x1qmw~j(I2_+@56d`{gYdtGWge)!p|PgUxSS2j0umpAS3Mk&t2`j`3{?Tq zBR+2yp8!&Zv3f5FJAsHP^RBjMf#l0~%6|armbw2ukPMmoKLI)GK|T+%weI^yWo!QR RN^ZM;;Fx6VfAM|g{{n)1&HDfV diff --git a/duellist-spielesammlung-projekt/src/duellist-spielesammlung-projekt.c b/duellist-spielesammlung-projekt/src/duellist-spielesammlung-projekt.c index 7257b62..e632fa6 100644 --- a/duellist-spielesammlung-projekt/src/duellist-spielesammlung-projekt.c +++ b/duellist-spielesammlung-projekt/src/duellist-spielesammlung-projekt.c @@ -1,5 +1,6 @@ #include #include +#include #define max_hoehe 10 #define max_breite 10 @@ -31,9 +32,23 @@ char** erschafe_minenfeld(int hoehe, int breite, char inerhalb) { } void verteile_minen(char** mienen, int hoehe, int breite, int anzahl_minen) { + int i, rand_hoehe, rand_breite; + srand(time(NULL)); + + i = anzahl_minen; + + while (i > 0) { + rand_hoehe = (rand() % hoehe); + rand_breite = (rand() % breite); + if (mienen[rand_hoehe][rand_breite] == 0) { + mienen[rand_hoehe][rand_breite] = 1; + i--; + } + } } + int minesweeper() { int hoehe, breite; printf("Geben Sie an in welcher Hoehe das spielfeld sein soll:\n");