Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #37659
| Path | csiph.com!weretis.net!feeder7.news.weretis.net!news.szaf.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail |
|---|---|
| From | Arno Welzel <usenet@arnowelzel.de> |
| Newsgroups | comp.lang.javascript |
| Subject | Re: Lazy programmers guide to blizz |
| Date | Fri, 1 Nov 2019 11:04:10 +0100 |
| Lines | 41 |
| Message-ID | <h22e8qFlomcU1@mid.individual.net> (permalink) |
| References | <a5e610b3-f5ee-4d80-a085-0d9300fa5e1d@googlegroups.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=utf-8 |
| Content-Transfer-Encoding | 8bit |
| X-Trace | individual.net 2OZZne+cjaNRs3farnPVMwGjbibqCICVKjaR6f2hzBplZfmQxk |
| Cancel-Lock | sha1:6ToR1APuXy9AlxYC9tMgzRkw2UU= |
| In-Reply-To | <a5e610b3-f5ee-4d80-a085-0d9300fa5e1d@googlegroups.com> |
| Content-Language | en-US |
| Xref | csiph.com comp.lang.javascript:37659 |
Show key headers only | View raw
On 01.11.19 08:50, Jonas Thörnvall wrote:
> It so boring writing if intervals using < > or > <
> And hard to read
> Why not simplify
>
> if(A inside.interval(144-159))
> if (A outside.interval(144-159))
>
> Maybe there already is interval functions in javascript?
>
> Alteratively for the operator fixated
> if (144< A <159)
> if (144> A >159)
Hmmm...
A inside.interval(144-159)
vs.
A >= 144 && A <= 160
And you find the first one really simpler? I don't.
For example: does inside.interval() mean ">=" and "<=" or ">" and "<"?
This is not clear when looking at the code.
But if you prefer this, just create your own function - assuming, that
the interval means including the lower and upper limit:
function between(x, min, max) {
return x >= min && x <= max;
}
--
Arno Welzel
https://arnowelzel.de
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Lazy programmers guide to blizz Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-11-01 00:50 -0700
Re: Lazy programmers guide to blizz dr.j.r.stockton@gmail.com - 2019-11-01 02:42 -0700
Re: Lazy programmers guide to blizz Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-11-01 06:22 -0700
Re: Lazy programmers guide to blizz Silvio <silvio@internet.com> - 2019-11-01 18:21 +0100
Re: Lazy programmers guide to blizz Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-11-01 10:39 -0700
Re: Lazy programmers guide to blizz Silvio <silvio@internet.com> - 2019-11-02 19:45 +0100
Re: Lazy programmers guide to blizz Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-11-02 17:57 -0700
Re: Lazy programmers guide to blizz Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-11-01 10:42 -0700
Re: Lazy programmers guide to blizz John G Harris <niam@jghnorth.org.uk.invalid> - 2019-11-01 09:58 +0000
Re: Lazy programmers guide to blizz Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-11-01 12:22 -0700
Re: Lazy programmers guide to blizz dr.j.r.stockton@gmail.com - 2019-11-01 14:02 -0700
Re: Lazy programmers guide to blizz Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-11-01 15:19 -0700
Re: Lazy programmers guide to blizz Arno Welzel <usenet@arnowelzel.de> - 2019-11-01 11:04 +0100
Re: Lazy programmers guide to blizz Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-11-01 06:27 -0700
Re: Lazy programmers guide to blizz Arno Welzel <usenet@arnowelzel.de> - 2019-11-05 11:06 +0100
Re: Lazy programmers guide to blizz luserdroog <luser.droog@gmail.com> - 2019-11-01 10:44 -0700
Re: Lazy programmers guide to blizz Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-11-01 13:19 -0700
Re: Lazy programmers guide to blizz Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-11-01 13:23 -0700
Re: Lazy programmers guide to blizz Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-11-02 03:57 -0700
Re: Lazy programmers guide to blizz Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-11-02 04:02 -0700
Re: Lazy programmers guide to blizz Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-11-02 04:44 -0700
Re: Lazy programmers guide to blizz Arno Welzel <usenet@arnowelzel.de> - 2019-11-05 11:20 +0100
Re: Lazy programmers guide to blizz Arno Welzel <usenet@arnowelzel.de> - 2019-11-05 11:14 +0100
Re: Lazy programmers guide to blizz luserdroog <luser.droog@gmail.com> - 2019-11-01 14:48 -0700
Re: Lazy programmers guide to blizz John G Harris <niam@jghnorth.org.uk.invalid> - 2019-11-02 14:23 +0000
Re: Lazy programmers guide to blizz Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-11-02 08:17 -0700
Re: Lazy programmers guide to blizz John G Harris <niam@jghnorth.org.uk.invalid> - 2019-11-02 18:12 +0000
Re: Lazy programmers guide to blizz Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-11-02 17:56 -0700
Re: Lazy programmers guide to blizz Arno Welzel <usenet@arnowelzel.de> - 2019-11-05 11:14 +0100
Re: Lazy programmers guide to blizz luserdroog <luser.droog@gmail.com> - 2019-11-05 09:04 -0800
Re: Lazy programmers guide to blizz Flng Fck <nothanks@invalid.invalid> - 2019-11-04 11:31 +0100
Re: Lazy programmers guide to blizz Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-11-04 02:46 -0800
Re: Lazy programmers guide to blizz Gregor Kofler <usenet@gregorkofler.com> - 2019-11-07 14:59 +0100
Re: Lazy programmers guide to blizz Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-11-04 02:48 -0800
Re: Lazy programmers guide to blizz Silvio <silvio@internet.com> - 2019-11-05 09:38 +0100
csiph-web