snowflake(1, [60,-60,180]). snowflake(N, Ls) :- N > 1, N1 is N - 1, snowflake(N1, Ls0), sf(Ls0, Ls). sf([],[]). sf([X|Xs], [X,A,B,C|Ys]) :- ( X =< 120 -> A is X + 60 ; A is X - 300 ), ( X > -120 -> B is X - 60 ; B is X + 300 ), C is X, sf(Xs, Ys).