replacing in nested list ??
for example
[[1 2][3 4] [5 1]]
to
[[99 2][3 4] [5 1]]
Can anybody please clarify the use of lists in Netlogo?
replacing in nested list ??
for example
[[1 2][3 4] [5 1]]
to
[[99 2][3 4] [5 1]]
Can anybody please clarify the use of lists in Netlogo?
Your question is somewhat underspecified. How do you want to decide which item gets changed?
I'll suppose that you want to do it by indices, e.g. "0th item of 0th sublist". Then that's:
You could also imagine doing the replacement according to other criteria. For example, suppose we want to change all of the occurrences of 1 in the first item of a sublist to 99. Then that's:
A lot of other answers are possible as well, depending on exactly what problem you're trying to solve.