Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better way of setting items in lists #288

Open
Ashvin-Ranjan opened this issue Dec 4, 2021 · 0 comments
Open

Better way of setting items in lists #288

Ashvin-Ranjan opened this issue Dec 4, 2021 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed
Milestone

Comments

@Ashvin-Ranjan
Copy link
Contributor

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.

@Ashvin-Ranjan Ashvin-Ranjan added this to the N 0.1 milestone Dec 4, 2021
@Ashvin-Ranjan Ashvin-Ranjan added enhancement New feature or request help wanted Extra attention is needed labels Dec 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant