summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--math/nimm.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/math/nimm.cpp b/math/nimm.cpp
new file mode 100644
index 0000000..3da6ca1
--- /dev/null
+++ b/math/nimm.cpp
@@ -0,0 +1,6 @@
+#Most important function!!
+bool WinNimm(vector<int> game) {
+ int result = 0;
+ for(int s: game) result ^= s;
+ return s > 0;
+}