Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
17
Task/Department-numbers/Prolog/department-numbers.pro
Normal file
17
Task/Department-numbers/Prolog/department-numbers.pro
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
dept(X) :- between(1, 7, X).
|
||||
|
||||
police(X) :- member(X, [2, 4, 6]).
|
||||
fire(X) :- dept(X).
|
||||
san(X) :- dept(X).
|
||||
|
||||
assign(A, B, C) :-
|
||||
police(A), fire(B), san(C),
|
||||
A =\= B, A =\= C, B =\= C,
|
||||
12 is A + B + C.
|
||||
|
||||
main :-
|
||||
write("P F S"), nl,
|
||||
forall(assign(Police, Fire, Sanitation), format("~w ~w ~w~n", [Police, Fire, Sanitation])),
|
||||
halt.
|
||||
|
||||
?- main.
|
||||
Loading…
Add table
Add a link
Reference in a new issue