MathGroup Archive 1995

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Challenge!

  • To: mathgroup at christensen.cybernetics.net
  • Subject: [mg987] Re: Challenge!
  • From: "Arnold Seiken" <SEIKENA at GAR.UNION.EDU>
  • Date: Thu, 4 May 1995 07:54:44 -0400

Dear Mathgroup,
        A solution for any number of lists of equal length.

swap[x_?MatrixQ] :=
Map[ Part[#,  Random[Integer, {1,Length[x]}  ]  ]&,
Transpose[ x ] ]

In[12]:=
swap[{{a,b,c,d,e}, {A,B,C,D,E}, {1,2,3,4,5}}]
Out[12]=
{A, 2, c, d, E}

Arnold Seiken



  • Prev by Date: Books
  • Next by Date: Re: Programming: List Structure Manipulation
  • Previous by thread: Re: Challenge!
  • Next by thread: Re: Challenge!