NNimClover
Product

Product features · Normal-play Nim moves

01

NimClover helps examine pile reductions under the last-object-wins rule, checking the xor invariant and leaving losing positions explicit.

01

Connection

Base URL, credentials and a reachable server.

02

Selection

A model available through the configured endpoint.

03

Capabilities

Context limits and tool support are determined by the model and server.

Normal-play Nim moves

● ● ●NimClover●
A concrete starting point · Normal-play Nim moves ×
def nim_move(piles):
    if type(piles) not in (list, tuple) or len(piles) > 128 or any(type(v) is not int or not 0 <= v <= 10**9 for v in piles):
        raise ValueError("nim.piles")
    balance = 0
    for pile in piles:
        balance ^= pile
    if balance == 0:
        return None
    for index, pile in enumerate(piles):
        reduced = pile ^ balance
        if reduced < pile:
            return index, reduced
✳Choose a winning reduction for normal-play Nim from at most 128 piles of zero through one billion objects.
✓ ChangesReview before applying ↗
Illustrative workspace
AI coding workspace

Your next change starts here.

Get the Windows app ↗