Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

While we're posting code, here's one I've conjectured to always work:

def loses(triplet):
     c,b,a = sorted(triplet); mod = 1
     if (a,b,c) == (a,a,(0 if a==1 else a)): return True
     while c >= mod//2:
         if (b%mod,c%mod,(b//mod)&~(b//mod+c//mod)) == (mod//2,mod//2,0): return a == b + c + (1 - mod//2 if mod > 1 else 2)
         mod *= 2
     return a == b + c + 1
def move(triplet): #example input: move((99,100,101))
     if loses(triplet): print(triplet,"loses"); return
     a,b,c = triplet
     for trip in [(i,b,c) for i in range(a)]+[(a,j,c) for j in range(b)]+[(a,b,k) for k in range(c)]:
         if loses(trip): print(trip)