traces-solver

1.0.0 • Public • Published

traces-solver

Simple solver for the iOS game logic traces.

The main idea is backtracking algorithm with little optimization. Please check test files for usage.

Hope a web page can be set up in the future!

var Grid = require('traces-solver').Grid;

var input = [
    [0, 0, 0, 0, 0, 0, 0, 4],
    [2, 0, 2, 0, 0, 0, 3, 0],
    [0, 0, 0, 0, 3, 0, 0, 0],
    [0, 9, 0, 0, 0, 3, 0, 0],
    [2, 0, 0, 0, 0, 6, 0, 0],
    [0, 0, 3, 0, 0, 0, 0, 0],
    [0, 0, 0, 1, 0, 0, 0, 5],
    [0, 0, 0, 0, 5, 0, 2, 0]
];

var grid = new Grid(input);
// grid.debug = true;
grid.solve();
grid.print();

Package Sidebar

Install

npm i traces-solver

Weekly Downloads

2

Version

1.0.0

License

MIT

Last publish

Collaborators

  • chinesedfan