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

Add wrapping access #6

Open
KyNorthstar opened this issue Feb 22, 2020 · 0 comments
Open

Add wrapping access #6

KyNorthstar opened this issue Feb 22, 2020 · 0 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@KyNorthstar
Copy link
Collaborator

API idea example:

let example = [1, 2, 3, 4]

print(exmaple[wrapping: 5]) // 2
print(exmaple[wrapping: 4]) // 1
print(exmaple[wrapping: 3]) // 4
print(exmaple[wrapping: 2]) // 3
print(exmaple[wrapping: 1]) // 2
print(exmaple[wrapping: 0]) // 1
print(exmaple[wrapping: -1]) // 4
print(exmaple[wrapping: -2]) // 3
print(exmaple[wrapping: -3]) // 2
print(exmaple[wrapping: -4]) // 1
print(exmaple[wrapping: -5]) // 4
print(exmaple[wrapping: -6]) // 3
@KyNorthstar KyNorthstar added enhancement New feature or request good first issue Good for newcomers labels Feb 22, 2020
@KyNorthstar KyNorthstar self-assigned this Feb 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant