Comment detail

アレイのuniq (Nested Flatten)

This comment is reply for 485 takatoh: 再帰で(アレイのuniq). Go to thread root.

#496は無かったことにしたいんですけど。orz
 $ pl -sq uniq.pl
[3, 1, 4, 5, 9, 2, 6, 8, 7]
 $
1
2
3
4
5
% uniq.pl
uniq([],[]).
uniq([A|As],[A|Bs]):-uniq(As,Bss), delete(Bss,A,Bs).

:-uniq([3,1,4,1,5,9,2,6,5,3,5,8,9,7,9],W), writeln(W).

Index

Feed

Other

Link

Pathtraq

loading...