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

[interval] Implements 'in' operator #14

Merged
merged 1 commit into from
Jul 21, 2023

Conversation

Hazurl
Copy link
Contributor

@Hazurl Hazurl commented Jul 18, 2023

The first use for an interval is checking whether some value is inside the bounds of it. It can already helps some construct like if (x >= a && x <= b)

// Leekscript
return value in [min..max]

// Java
return new Interval(min, max).contains(value)

@Hazurl Hazurl force-pushed the haz/interval-in branch 2 times, most recently from 4f8a84c to f6a0490 Compare July 18, 2023 20:51

Verified

This commit was signed with the committer’s verified signature.
AThousandShips A Thousand Ships
@Hazurl Hazurl force-pushed the haz/interval-in branch from f6a0490 to 2ad810c Compare July 18, 2023 21:02
@5pilow
Copy link
Member

5pilow commented Jul 21, 2023

Thank you!

@5pilow 5pilow merged commit 4c0793d into leek-wars:master Jul 21, 2023
@Hazurl Hazurl deleted the haz/interval-in branch July 21, 2023 07:41
@Hazurl Hazurl mentioned this pull request Jul 30, 2023
15 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants