diff options
| author | JBatzill <batzilljohannes@gmail.com> | 2014-11-25 16:13:13 +0100 |
|---|---|---|
| committer | JBatzill <batzilljohannes@gmail.com> | 2014-11-25 16:13:13 +0100 |
| commit | 0ad526363ba0a83b0711ba232153f5be044ce8e5 (patch) | |
| tree | f2259042cb2b06288ee10d7d1c0930a924c49285 /math | |
| parent | 8db16ab900b536f23150e500514455341313b2cd (diff) | |
Create nimm.cpp
Diffstat (limited to 'math')
| -rw-r--r-- | math/nimm.cpp | 6 |
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; +} |
