Skip to content

Better way of setting items in lists #288

@Ashvin-Ranjan

Description

@Ashvin-Ranjan

Currently in N to do something like this:

boardShadows[i][j][k] = True

You have to do:

boardShadows = [
  ..boardShadows.subsection(0, i),
  [
    ..(boardShadows[i] | []).subsection(0, j),
    [
      ..(boardShadows[i][j] | []).subsection(0, k),
      true,
      ..(boardShadows[i][j] | []).subsection(k + 1, (boardShadows[i][j] | []).len()),
    ],
    ..(boardShadows[i] | []).subsection(j + 1, (boardShadows[i] | []).len()),
  ],
  ..boardShadows.subsection(i + 1, boardShadows.len())
]

This is really cumbersome and large for such a simple task, there surely has to be a better way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions