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

Feature: Arrays #1

Open
PokeJofeJr4th opened this issue Jun 30, 2023 · 0 comments
Open

Feature: Arrays #1

PokeJofeJr4th opened this issue Jun 30, 2023 · 0 comments
Labels
feature New feature or request

Comments

@PokeJofeJr4th
Copy link
Owner

Arrays

Some languages start arrays at 0, which can be unintuitive for beginners. Some languages start arrays at 1, which isn't representative of how the code actually works. DreamBerd does the best of both worlds: Arrays start at -1.

const const scores = [3, 2, 5]!
print(scores[-1])! //3
print(scores[0])!  //2
print(scores[1])!  //5

New for 2022!

You can now use floats for indexes too!

const var scores = [3, 2, 5]!
scores[0.5] = 4!
print(scores)! //[3, 2, 4, 5]
@PokeJofeJr4th PokeJofeJr4th added the feature New feature or request label Jun 30, 2023
PokeJofeJr4th added a commit that referenced this issue Jul 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant