From 0ad526363ba0a83b0711ba232153f5be044ce8e5 Mon Sep 17 00:00:00 2001 From: JBatzill Date: Tue, 25 Nov 2014 16:13:13 +0100 Subject: Create nimm.cpp --- math/nimm.cpp | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 math/nimm.cpp (limited to 'math') 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 game) { + int result = 0; + for(int s: game) result ^= s; + return s > 0; +} -- cgit v1.2.3