From: constraintAutomaton Date: Sat, 12 Apr 2025 05:18:00 +0000 (+0200) Subject: Example update to use iterable. X-Git-Tag: v0.10.0~55^2 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=3090cb0084cde9b6be125c0011fda77e0e2ed344;p=scryer-prolog.git Example update to use iterable. --- diff --git a/README.md b/README.md index 68a4cec8..c1451221 100644 --- a/README.md +++ b/README.md @@ -254,8 +254,8 @@ Then a `pkg` directory will be created, containing everything you need for a web const formattedSolutions = []; // Format the answers - for (let solution = answers.next(); !solution.done; solution = answers.next()) { - const rows = solution.value.bindings["Rows"].list; + for (const solution of answers) { + const rows = solution.bindings["Rows"].list; const grid = rows.map(row => row.list.map(cell => cell.integer) @@ -283,7 +283,6 @@ Then a `pkg` directory will be created, containing everything you need for a web - ``` Then you can serve it with your favorite http server like `python -m http.server` or `npx serve`, and access the page with your browser.