16 lines
298 B
Plaintext
16 lines
298 B
Plaintext
#include "reachin1000".
|
|
|
|
source(3).
|
|
|
|
% Way 1
|
|
reach(X) :- source(X).
|
|
reach(Y) :- edge(X,Y), reach(X).
|
|
% Way 2
|
|
%reach(Y) :- edge(X,Y), reach(X).
|
|
%reach(X) :- source(X).
|
|
% Way 3
|
|
%reach(X) :- source(X).
|
|
%reach(Y) :- reach(X), edge(X,Y).
|
|
% Way 4
|
|
%reach(Y) :- reach(X), edge(X,Y).
|
|
%reach(X) :- source(X). |