/NumberMatchSolver

Solver for the classic number matching game, written in C++ under MIT license

Primary LanguageC++MIT LicenseMIT

NumberMatchSolver Quality Gate Status

This is a solver for the classic number matching game, written in C++ under MIT license.

EasybrainNumberMatch

principles

Recursion. Complexity is reduced by deleting the grids already played.

By default

  • the grid has 9 columns,
  • numbers can match horizontally, vertically or diagonally,
  • the solver stops after first winning sequence is attained,
  • the grid numbers can be duplicated until 4 times when no cut is possible,
  • the winning sequence is shown in once, but you can unroll it interactively.

All these topics are configurable.

build

The build process uses cmake and your favorite C++ compiler.

➜  cmake . && make

run

➜  NumberMatchSolver ./numberMatchSolver -h

NumberMatchSolver

syntax: numberMatchSolver [options] <grid>
Options can be:
-o, --one-cut: find the first playable cut only
-c, --continue: try to find all winning sequences (can be very long)
-i, --interactive: ask user for next step
-l, --line-length <line length>: set the grid line length, must be >=2 (default 9)
-a, --add <num>: max times numbers can be added, must be >=0 (default 4)
-d, --diagonals: make diagonal numbers match too, can be y or n (default y)
-h, --help: this help message

ex: ./numberMatchSolver --interactive 262557596931762454465213897

which games does it solves

Number Match by Easybrain

Number Match by Happy Coloring Platform

Numberama and Numberama 2 by Lars Feßen

etc.