Resetting a completed level softlocks the game - the level restarts, but the player can't move, even after further resets.
FundamentalSequence
3
Posts
A member registered 75 days ago
Recent community posts
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)