This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| % A Prolog solver for the Weaver (word ladder) puzzle | |
| % https://wordwormdormdork.com/ | |
| :- dynamic goal/1. | |
| weaver(Start, Goal, Solution) :- | |
| retractall(goal(_)), | |
| assert(goal(Goal)), | |
| a_star(Start, Solution). |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # fun_logger.py | |
| # For details see: https://www.aswinvanwoudenberg.com/posts/call-me-maybe/ | |
| import logging | |
| import graphviz | |
| from logging import StreamHandler | |
| from functools import wraps, partial | |
| def fun_logger(func=None, *, logging=logging, indent=' ', exit=False): | |
| if func is None: |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| % A Prolog solver for the Skyline puzzle | |
| % http://www.constantin-jean-clau.de/ | |
| print_solution(X,Y) :- solve(X,Y,Sol), print_board(Sol). | |
| pos(X,Y,_) :- member(X,[1,2,3,4,5,6,7]), member(Y,[1,2,3,4,5,6,7]). | |
| board(Board) :- findall(pos(X,Y,_),pos(X,Y,_),Board). | |
| solve(X,Y,Board) :- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| % A Prolog solver for the bridge and torch puzzle | |
| % https://en.wikipedia.org/wiki/Bridge_and_torch_problem | |
| print_all_solutions :- | |
| findall(_,print_solution,_). | |
| print_solution :- | |
| init(State), | |
| solve(State,Solution,EndState), | |
| writeln('Start state:'), |