RegexWars
Tier 1 · Sorcerermatch

The Last Match Loses

Two piles of matchsticks. Each turn you take as many as you like from one pile, and whoever takes the last match loses. Match the positions that are already lost for the player about to move.

Each pile is a run of 1s and the two piles are separated by a hash. An empty pile is an empty run, so "1#" is one match and none, and "#" is no matches at all. With the ordinary rule — last match wins — two-pile Nim is solved in a line: you are lost exactly when the piles are equal, because whatever you take, your opponent takes the same from the other side. The misère rule keeps that answer nearly everywhere and breaks it right at the bottom of the board, where copying stops being safe. Find the exceptions. There are not many, and they are not where you expect.

Your pattern0 chars · par 20
//
Flags
Start typing — tests run as you go.0 of 7 visible tests passing
Test cases
  • 11#11must match

    two and two

  • 1#must match

    one and none — you must take it

  • #1must match

    and the same the other way round

  • 1#1must not match

    one each: take yours and they are forced to take the last

  • #must not match

    nothing left, so they took the last match and you have won

  • 11#111must not match

    two and three

  • 11#must not match

    two and none

+ 10 hidden tests, checked when you submit. They are what stops a pattern that only fits the examples above.