a pattern-matching game