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();

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.0
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.0
    1

Package Sidebar

Install

npm i traces-solver

Weekly Downloads

1

Version

1.0.0

License

MIT

Last publish

Collaborators

  • chinesedfan