summaryrefslogtreecommitdiff
path: root/math/nimm.cpp
diff options
context:
space:
mode:
authorJBatzill <batzilljohannes@gmail.com>2014-11-25 16:13:13 +0100
committerJBatzill <batzilljohannes@gmail.com>2014-11-25 16:13:13 +0100
commit0ad526363ba0a83b0711ba232153f5be044ce8e5 (patch)
treef2259042cb2b06288ee10d7d1c0930a924c49285 /math/nimm.cpp
parent8db16ab900b536f23150e500514455341313b2cd (diff)
Create nimm.cpp
Diffstat (limited to 'math/nimm.cpp')
-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;
+}