-
-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathapp.js
More file actions
17 lines (14 loc) · 595 Bytes
/
app.js
File metadata and controls
17 lines (14 loc) · 595 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
var strips = require('strips');
// Load the domain and problem.
strips.load('./examples/blocksworld2/domain.txt', './examples/blocksworld2/problem.txt', function(domain, problem) {
// Run the problem against the domain.
var solutions = strips.solve(domain, problem);
// Display each solution.
for (var i in solutions) {
var solution = solutions[i];
console.log('- Solution found in ' + solution.steps + ' steps!');
for (var i = 0; i < solution.path.length; i++) {
console.log((i + 1) + '. ' + solution.path[i]);
}
}
});