predicates
go
buzz(integer)
check(integer)
buzz3(integer)
buzz7(integer)
clauses
go:-
buzz(1).
buzz(26).
buzz(N):-
write(N),
check(N),
NN=N+1,
buzz(NN).
check(N):-
R=N mod 3,
buzz3(R),
P=N mod 7,
buzz7(P),
write("\n").
buzz3(0):-
write(" Buzz3").
buzz3(X).
buzz7(0):-
write(" Buzz7").
buzz7(X).
OUT PUT
=======
1
2
3 Buzz3
4
5
6 Buzz3
7 Buzz7
8
9 Buzz3
10
11
12 Buzz3
13
14 Buzz7
15 Buzz3
16
17
18 Buzz3
19
20
21 Buzz3 Buzz7
22
23
24 Buzz3
25
Yes