| Author |
Comment/Response |
Aaron Honecker
|
10/31/00 1:27pm
>OK, having a list of the form {a,b,c,d...}, how do I make this into the form {{a,b},{b,b},{b,c},{c,c},{c,d},{d,d}...}? Thanks
Here's one way
A = {a, b, c, d};
ReplaceList[A, {___, $x_, $y_, ___} -> Sequence[{$x, $y}, {$y, $y}]]
produces
{{a, b}, {b, b}, {b, c}, {c, c}, {c, d}, {d, d}}
URL: , |
|