Difference between revisions of "Array.pip()"

From ZCubes Wiki
Jump to navigation Jump to search
(Created page with "* << Z3 Home * Z3 Language Documentation * Z%5E3_Array_Manipulation_Member_Functions | Listing of Z3 Array Manipulation Member F...")
 
Line 6: Line 6:
  
 
*pip is push plus insert. The array is split at the nodes in SomePathIndexArray, and a slice of length SomeLength is pushed into these array indices, and the values are massaged with SomePassThroughFunction if provided.
 
*pip is push plus insert. The array is split at the nodes in SomePathIndexArray, and a slice of length SomeLength is pushed into these array indices, and the values are massaged with SomePassThroughFunction if provided.
 +
*pip modifies the original array.
 +
*SomePathIndexArray is array indices to refer to a specific cell in the array to be pip-ed.
  
 
Example:
 
Example:
Line 27: Line 29:
  
 
10
 
10
 +
 +
MAGICSQUARE(3).pip([1,1],2).print()
 +
 +
[
 +
[2,7,6 ],
 +
 +
[9,
 +
[5,1 ]
 +
],
 +
 +
[4,3,8 ]
 +
]

Revision as of 11:10, 5 February 2020

Array.pip(SomePathIndexArray, SomeLength, SomePassThroughFunction)

  • pip is push plus insert. The array is split at the nodes in SomePathIndexArray, and a slice of length SomeLength is pushed into these array indices, and the values are massaged with SomePassThroughFunction if provided.
  • pip modifies the original array.
  • SomePathIndexArray is array indices to refer to a specific cell in the array to be pip-ed.

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 ] ]