Jump to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Simple Interval class

Featured Replies

07dbdbcc8019af1e4bb058252b8ea51a.png

public class Interval {

	private final long firstEntry;
	private final long lastEntry;

	private final boolean includeFirstEntry;
	private final boolean includeLastEntry;
	
	public Interval(final boolean includeFirstEntry, final long firstEntry, final long lastEntry, final boolean includeLastEntry) {
		this.firstEntry = firstEntry;
		this.lastEntry = lastEntry;
		this.includeFirstEntry = includeFirstEntry;
		this.includeLastEntry = includeLastEntry;
	}
	
	public boolean contains(long n) {
		return (n == firstEntry && includeFirstEntry) || (n == lastEntry && includeLastEntry) || (n > firstEntry && n < lastEntry);
	}

}

ff5ca46a0535837505bc4da922ee7198.png

Edited by Botrepreneur

Can just make always not including firstEntry, lastEntry? And like if(includeFirstEntry) firstEntry--; if(includeLastEntry) lastEntry++;

  • Author

Can just make always not including firstEntry, lastEntry? And like if(includeFirstEntry) firstEntry--; if(includeLastEntry) lastEntry++;

 

I see what you mean, I could but I prefer the boolean specification because it mimics the mathematical notation for intervals.

 

[ 1, 40 [

 

=

 

a8855ed3e97ede4e0dd3d5c461319760.png

 

 

Edited by Botrepreneur

I see what you mean, I could but I prefer the boolean specification because it mimics the mathematical notation for intervals.

 

[ 1, 40 [

 

=

 

a8855ed3e97ede4e0dd3d5c461319760.png

i see what you mean, it does look like it biggrin.png

i think you meant

 

[ 1,40 )

Edited by josedpay

Guest
This topic is now closed to further replies.

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.