From f913f3cfbc8d434afd08af234f8d408e4e9b017d Mon Sep 17 00:00:00 2001 From: Luis Hahn Date: Sat, 27 Jan 2024 21:19:41 +0100 Subject: [PATCH] refactoring: Main ausgelagert, Luis Hahn --- .vscode/launch.json | 7 +++++++ build/test/dependencies/schach.d | 2 +- build/test/dependencies/test_schach.d | 2 +- build/test/out/c/cmock.o | Bin 8459 -> 8447 bytes build/test/out/c/schach.o | Bin 6652 -> 6636 bytes build/test/out/c/test_schach.o | Bin 5914 -> 5902 bytes build/test/out/c/test_schach_runner.o | Bin 6891 -> 6875 bytes build/test/out/c/unity.o | Bin 42166 -> 42150 bytes build/test/out/test_schach.out | Bin 461191 -> 461191 bytes build/test/results/test_schach.pass | 2 +- src/main.c | 16 ++++++++++++++++ src/main.h | 9 +++++++++ src/schach.c | 14 ++------------ src/schach.h | 2 ++ 14 files changed, 39 insertions(+), 15 deletions(-) create mode 100644 .vscode/launch.json create mode 100644 src/main.c create mode 100644 src/main.h diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..5c7247b --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,7 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [] +} \ No newline at end of file diff --git a/build/test/dependencies/schach.d b/build/test/dependencies/schach.d index 5d25a68..6bb1d15 100644 --- a/build/test/dependencies/schach.d +++ b/build/test/dependencies/schach.d @@ -1 +1 @@ -build/test/out/c/schach.o: src/schach.c +build/test/out/c/schach.o: src/schach.c src/main.h diff --git a/build/test/dependencies/test_schach.d b/build/test/dependencies/test_schach.d index 3ac337a..da8e9a4 100644 --- a/build/test/dependencies/test_schach.d +++ b/build/test/dependencies/test_schach.d @@ -1,4 +1,4 @@ build/test/out/c/test_schach.o: test/test_schach.c \ C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h \ C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity_internals.h \ - src/schach.h + src/schach.h src/main.h diff --git a/build/test/out/c/cmock.o b/build/test/out/c/cmock.o index b1d3bb25ab36ca903eff8cfb72c999f1d474ea11..6e80141b2f7f57f28cf860f0499ecd4d3262069e 100644 GIT binary patch delta 186 zcmeBn`tQh@(#FRC0!|Y-l^Ing>Z&t}ObngR*fjC0I^(*@vW)7CWs_YQ{Tc5~o(g1t zn!K0Moz<9;fnnd|hm0bVWtoH-KW;W;;t^0P1sXC7h#vtl6Qev6KMOlh86!W45C;*O zo8yIcFq-6)W)^3}6cpuWrDm7Jgd}E{WM=24W)_#E7BM(m>4z4l78UD*73o72>4!{? T6uG`xPn3y+(Rj0=>@8*h*i$o` delta 204 zcmezG*zLrb(#FRC0)7)Yl^G2t>Z&s;ObngR*f;U3I^(X%vW)7CO_N<2{TW|Po(g3D zo4l9Noz;<%fnnd|hm0bVWtoH-|8F*A;t^1)0UELbh(7=^6Qev6KZ__(8KW$SPz4d@ zo8yIcFgm5?<|gLF6cpuWr6!le7bj;VCTGNyBxaXnX6L467MG+JF*sZ4hZd(673+i5 e>Z7XFFPZEua(%IiCsL7ZxP<6=(uTwvr)86~g9_6at9_^FTBPuw4Ke00L_u6az~pLnt3a zZ44U|6GSu%CYi+$F?k}lETiY-_1w~Co^lB5J$0cL04?)0fv^SGjG?CI!wkq|@S4OU z!{|L(mPbm%itRB}+!jhR&Z%KxU|^|Wu;GLlk;78SU^6+MM~qQ(av6_0qxR-`Jgm$* zMnLu9KpYLkOpNkO{A>+C7Go!fI}ya11!64*5o;%(=eK6uw3%DLoRL4LG_yD(rl2T4 pD>b_$CS-DipfW^EA1bCFGI^rl+|33;&sZ6^O>`99tRr!O5dfoIUXTC) delta 459 zcmaE3{KuFxrHzjP1Qtx>RAw}os5_r=)5Np>j4hL88PypDCc85FGipqp3S`?%-plCD zdIYG{a`Hn)k;$@5!i;}68#4W1Wz^ZM#nH#am^gVSmo#spY$_uI1JgtX)(VEi$q%_? z7?URd+!jhR&Z%KxU|^|Wu;PRmk;78SU^O|OM~qQ@av6_0qvqy$Jgm$* zmO%BXK%5E0OpNkO{A_(d7UOgfcRq-<0>s(~B6d$c&u`7RVKcXYIipx=Zf;^;OhHk8 wR%&udd~tF{Vsb`I$>cymWr&nMs+4}oPx# diff --git a/build/test/out/c/test_schach.o b/build/test/out/c/test_schach.o index 0cf527d80151b88230e428beaebb45a283ecea3c..75a55e7be7aee20da1ec820fb5a184c981ecf238 100644 GIT binary patch delta 202 zcmbQG*Qdvs(#FRC0!JotDloyqD3P zRfv&+VfN&Qj3Sd|nS>eFZZ>4vz|5@5z%Y3?ujJ;xtWTI3xh6m2{KLq;`97C2v%Uq; z)9I80DGxSuX=wj1NJ?d$1VLTxQP6hJ3~RIi;D!88HP#`B|yiB{3nB fckyXL#Pp$J`XQ5l@_pX?ieHVDQE0QEC?^vDiCs4a delta 220 zcmeCvo2AE@(#FRC0v9H7Dl@*Bs5_tW!^E@xj2V+<8PyqgOm=1TXY`vq706DSyqD3P zRe_O#VfN&Qj3Sd|nS>d4Z#HDwz|5?}z%Y3?ujJ;xtWTI3IVL~i{KLq)`97C2v%Wph z4qB80DGxSswyfjPF6jUyv9-&|GHm$%cHzVyU^giFq*vMfq8&$tCf{ r$r*{s88Ic3H}h#ir1Vjx^h+kc=KH+)0lx|>lLF&JN0H4^qF)#RL;F8y diff --git a/build/test/out/c/test_schach_runner.o b/build/test/out/c/test_schach_runner.o index f76f87c74b034a7b5f4a3c5f8445a9aa59068139..163073133004acac1487b05433cb1d70ec17c0f4 100644 GIT binary patch delta 209 zcmaEDdfSvUrA?3l1RN%EDl_hxs5_tWz{IoujFTqIGO9DmO?GAUXWTM*Dv*6*@?J)F zM)S$6OxlbwlMR{FS$hN+7?dW*GAXmp0kU)^w*pyffGo4kYnduo7*!{q6%*fV%kIOj z<_ol-2#8yOcoh&cG0HRXvwQ-w7}*(tgba{iQk}e>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b-8Ouyd7+&ryD^D=n{`Uf!Pico9w}68UTEt@(An!J4hyG9V50vkm)?8&) zgBGQV&uF<_UbE?+*^K=$kS%x2HT>1LiAEl`7YO{b!0`KkFe{yxV%#=; zO-?haxczJWQTm|lvmOWWd&;=Y?R4L=TKBOANz5?DaywnUtaK+U{dr%b2<&tTv(gSL zot0%|0Uz%scjp`7YD>296+nMAH^&$c9Is+#)_s6+TyVUMU3kVA2fVwdl^#0?8*_gz zE6N{Y1aW@fONLFxf!5_2KLWr1gjL%#3@3p`b#1s2E9`Z+0Ba4)tu=HXiCyh<6|>SF zR(i%L>NP?AHQy-YFi^EGFlsq$Q1uR6oSm*>R`c(y*D<1yn*X5Ik2P*_xU8zj8|i|( z2FcPla6!!zjCjudf)y@r9N7Kv@440cSF88t65}4&=`v=eyI5;DT#E0Q_X<;AmK!f} zSg%5-8*4aJs$DaT_XU(F$IBRVyo9yPHa2ta5~V(vYYgE$FMTF`chmD4~$c|_yEp3cDA14qiXuy(w)p|-PLNHx{?Md z!DHD<->{x(`YK9~!lT$q|7N8>TaAOj2o?C25y&A=bz6@=d3uVq;OQIiMcL`XW_7Bu qrZ`$-WN@fct{btjovv+G+0QEX-$Y~1R9inVPIB0 +#include + +#include "schach.h" + +int main() { + int x = 8; + int y = 8; + + char** Spielfeld = create_Schachfeld(x, y); + print_Schachfeld(Spielfeld, x, y); + + free_Schachfeld(Spielfeld, x); + + return 0; +} diff --git a/src/main.h b/src/main.h new file mode 100644 index 0000000..7f696ff --- /dev/null +++ b/src/main.h @@ -0,0 +1,9 @@ +#ifndef MAIN +#define MAIN + + +int main(); + + + +#endif diff --git a/src/schach.c b/src/schach.c index 47adeca..9c87ce1 100644 --- a/src/schach.c +++ b/src/schach.c @@ -1,6 +1,8 @@ #include #include +#include "main.h" + /* Spielablauf: 1. Ausgabe vom Spielfeld @@ -101,16 +103,4 @@ void free_Schachfeld(char** Spielfeld, int x) { free(Spielfeld); } -/* -int main() { - int x = 8; - int y = 8; - - char** Spielfeld = create_Schachfeld(x, y); - print_Schachfeld(Spielfeld, x, y); - free_Schachfeld(Spielfeld, x); - - return 0; -} -*/ diff --git a/src/schach.h b/src/schach.h index 7b83d22..6412138 100644 --- a/src/schach.h +++ b/src/schach.h @@ -1,6 +1,8 @@ #ifndef SCHACH #define SCHACH +#include "main.h" + void print_Schachfeld(char** , int , int ); char** create_Schachfeld(int , int ); void free_Schachfeld(char** , int );