queck #5746(2008/02/12 12:59 GMT) [ Other ] Rating0/0=0.00
Factor です。reduce を使いました。
1 2 3 4 5 6 7 8
USING: kernel sequences ; : f ( seq -- uniqseq ) { } [ 2dup swap member? [ drop ] [ add ] if ] reduce ; USE: tools.test [ { 3 1 4 5 9 2 6 8 7 } ] [ { 3 1 4 1 5 9 2 6 5 3 5 8 9 7 9 } f ] unit-test
Rating0/0=0.00-0+
[ reply ]
queck
#5746()
[
Other
]
Rating0/0=0.00
Factor です。reduce を使いました。
USING: kernel sequences ; : f ( seq -- uniqseq ) { } [ 2dup swap member? [ drop ] [ add ] if ] reduce ; USE: tools.test [ { 3 1 4 5 9 2 6 8 7 } ] [ { 3 1 4 1 5 9 2 6 5 3 5 8 9 7 9 } f ] unit-testRating0/0=0.00-0+
[ reply ]