Skip to content

Instantly share code, notes, and snippets.

View Rhialto's full-sized avatar

Rhialto The M. Rhialto

View GitHub Profile
@Rhialto
Rhialto / wgc1.pl
Created September 22, 2015 18:52
Human Wolf Goat Cabbage version 1
#!/usr/pkg/bin/swi-prolog
%
% Solve the puzzle of the wolf, the goat and th cabbage
%
:- use_module(library(lists)).
go :-
Begin = situation([h,w,g,c], []),
Goal = situation([], [h,c,g,w]),
@Rhialto
Rhialto / wgc.pl
Last active September 22, 2015 19:36
Human Wolf Goat Cabbage, version 2
#!/usr/pkg/bin/swi-prolog
%
% Solve the puzzle of the wolf, the goat and the cabbage
%
% Version 2, using place(Human, Wolf, Goat, Cabbage).
:- use_module(library(lists)). % for member/2
go :-
go(Messages),