add progress to solver and introduce solver cli

This commit is contained in:
Tiago
2025-04-22 19:19:24 +01:00
parent ecf4758e76
commit 7779209fdc
9 changed files with 172 additions and 3 deletions
+12 -1
View File
@@ -21,4 +21,15 @@ const CHALLENGES = [
["0c21ade6e63a4e37b13cb8b087f31863", "65c9"],
];
console.log(await solver(CHALLENGES));
const solutions = await solver(CHALLENGES, {
onProgress: (status) => {
process.stdout.moveCursor(0, -1);
process.stdout.clearScreenDown();
console.log(`Progress: ${status.progress}%`);
},
});
process.stdout.moveCursor(0, -1);
process.stdout.clearScreenDown();
console.log("Solutions:", solutions);