RosettaCodeData/Task/Hailstone-sequence/Prolog/hailstone-sequence-6.pro
Ingy döt Net db842d013d A-M baby
2013-04-10 21:29:02 -07:00

6 lines
207 B
Prolog

task1 :-
hailstone(27),
findall(X, find_chr_constraint(hailstone(X)), L),
clean,
% check the requirements
( (length(L, 112), append([27, 82, 41, 124 | _], [8,4,2,1], L)) -> writeln(ok); writeln(ko)).