Array.pipall()
Revision as of 11:17, 5 February 2020 by Joseph (talk | contribs) (→Array.pipall(SomeExceptIndexUpto, SomeMarkSliced))
Array.pipall(SomeExceptIndexUpto, SomeMarkSliced)
- pip is push plus insert.
- pipall does not modify the original array.
- pipping starts at SomeExceptIndexUpto, and the arrays are marked as sliced if SomeMarkSliced is true. This may be useful for later unpipping
- pipallwithslice calls pipall with SomeMarkSliced marked as true.
Example: 1..10.pip(5,2)
1
2
3
4
5
6 7
8
9
10
MAGICSQUARE(3).pip([1,1],2).print()
[ [2,7,6 ],
[9, [5,1 ] ],
[4,3,8 ] ]
MAGICSQUARE(3).pip([1,1],2,x=>SUM(x)).print()
[ [2,7,6 ],
[9,6 ],
[4,3,8 ] ]