fork download
  1. @Mathematica
  2.  
  3. moveElements[a_,b_,c_,d_]:=Module[{lst1,lst2},
  4.  
  5. {lst1,lst2}=a//
  6. RotateLeft[#,b]&//
  7. {Take[#,c],Drop[#,c]}&;
  8.  
  9. lst2//
  10. RotateLeft[#,d]&//
  11. Join[lst1,#]&//
  12. RotateRight[#,b+d]&
  13. ];
  14.  
  15. In[1] := moveElements[{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }, 3, 1, 5]
  16. Out[1] = {0, 1, 2, 4, 5, 6, 7, 8, 3, 9}
  17.  
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty