aboutsummaryrefslogtreecommitdiff
path: root/week06/ex4.cpp
diff options
context:
space:
mode:
authorSyndamia <kamen@syndamia.com>2023-12-03 13:33:32 +0200
committerSyndamia <kamen@syndamia.com>2023-12-03 13:33:32 +0200
commit0996e05988b5d38faba0f616f06e6dcc7466930e (patch)
tree5efa650f38dddfaf0a1389a2cb2f4075bb76e8d8 /week06/ex4.cpp
parentebccf5fed44edd6f0971852701708259e855cd17 (diff)
downloadupp-2023-solutions-0996e05988b5d38faba0f616f06e6dcc7466930e.tar
upp-2023-solutions-0996e05988b5d38faba0f616f06e6dcc7466930e.tar.gz
upp-2023-solutions-0996e05988b5d38faba0f616f06e6dcc7466930e.zip
[w6] Added solutions for ex1 and ex2 with partials for ex3 and 4
Diffstat (limited to 'week06/ex4.cpp')
-rw-r--r--week06/ex4.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/week06/ex4.cpp b/week06/ex4.cpp
new file mode 100644
index 0000000..b500b33
--- /dev/null
+++ b/week06/ex4.cpp
@@ -0,0 +1,15 @@
+#include <iostream>
+
+int main() {
+ char chocolate[41][41] = { { '#' } };
+ size_t N, M;
+ std::cin >> N >> M;
+
+ bool firstPlayerTurn = false;
+ size_t row, col;
+ unsigned winStatus = 0;
+ do {
+ firstPlayerTurn = !firstPlayerTurn;
+ winStatus = chomp(chocolate, row, col);
+ } while(winStatus == 0);
+}