Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #38716
| From | Ben Bacarisse <ben.usenet@bsb.me.uk> |
|---|---|
| Newsgroups | comp.lang.javascript |
| Subject | Re: Allowed moves database chessboard, knight to many entries.... |
| Date | 2020-08-12 12:12 +0100 |
| Organization | A noiseless patient Spider |
| Message-ID | <87h7t886e5.fsf@bsb.me.uk> (permalink) |
| References | (9 earlier) <39f38e8f-f303-4f76-9034-dc51bf49f7d6o@googlegroups.com> <XnsAC16EFA465EBFeejj99@194.109.6.166> <c097e9ab-72d6-4cc2-9198-722d4635c449o@googlegroups.com> <c24429d5-85ff-434c-aa10-728dea2d6283o@googlegroups.com> <5eec68a9-bbe9-48d9-895c-91cc335b9439o@googlegroups.com> |
Jonas Thörnvall <jonas.thornvall@gmail.com> writes:
> Den onsdag 12 augusti 2020 kl. 09:40:48 UTC+2 skrev Jonas Thörnvall:
>> Den onsdag 12 augusti 2020 kl. 00:57:32 UTC+2 skrev luserdroog:
>> > On Tuesday, August 11, 2020 at 4:33:36 PM UTC-5, Evertjan. wrote:
>> > > <jonas.thornvall@gmail.com> wrote on 11 Aug 2020 in comp.lang.javascript:
>> > >
>> > > > Honestly Evertjan i find
>> > > > Math.random() < 0.5
>> > > > giving a boolean weird enough
>> > >
>> > > The result of any comparison must be a boolean.
>> > >
>> > > Programming needs some honest brain exercise.
>> > >
>> >
>> > Without going too far out on a limb, I support the use of relational
>> > operators to produce boolean values. (I also like implicit conversion
>> > from 0 and 1.)
>>
>> if (Math.random<0.5) {holder=false;}
(you meant to call the function: if (Math.random()<0.5) {holder=false;}
> Not holder=Math.random<0.5
> It is both syntactical and semantical gibberish
Your code is not equivalent to assignment you dislike. You'd need
something like
if (Math.random()<0.5) holder=false; else holder=true;
But what do you think the "Math.random() < 0.5" in the "if" is if not an
expression yielding a true/false result? And if that is what it is, why
not allow the result to be assigned just like the result of any pther
expression?
Many decades ago, before we knew how to do this stuff, there were
programming languages that only allowed relations and comparisons in
certain positions (the test of an "if" or a "while" etc.) but thankfully
those days are long gone.
--
Ben.
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Allowed moves database chessboard, knight to many entries.... Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-07-28 14:31 -0700
Re: Allowed moves database chessboard, knight to many entries.... Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-07-28 14:53 -0700
Re: Allowed moves database chessboard, knight to many entries.... "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2020-07-29 00:55 +0200
Re: Allowed moves database chessboard, knight to many entries.... Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-08-06 09:31 -0700
Re: Allowed moves database chessboard, knight to many entries.... "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2020-08-06 19:01 +0200
Re: Allowed moves database chessboard, knight to many entries.... Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-08-08 04:43 -0700
Re: Allowed moves database chessboard, knight to many entries.... Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-08-08 04:53 -0700
Re: Allowed moves database chessboard, knight to many entries.... "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2020-08-08 14:45 +0200
Re: Allowed moves database chessboard, knight to many entries.... Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-08-10 02:11 -0700
Re: Allowed moves database chessboard, knight to many entries.... "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2020-08-10 12:48 +0200
Re: Allowed moves database chessboard, knight to many entries.... Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-08-11 11:24 -0700
Re: Allowed moves database chessboard, knight to many entries.... "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2020-08-11 23:33 +0200
Re: Allowed moves database chessboard, knight to many entries.... Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-08-11 14:40 -0700
Re: Allowed moves database chessboard, knight to many entries.... luserdroog <luser.droog@gmail.com> - 2020-08-11 15:57 -0700
Re: Allowed moves database chessboard, knight to many entries.... Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-08-12 00:40 -0700
Re: Allowed moves database chessboard, knight to many entries.... Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-08-12 00:42 -0700
Re: Allowed moves database chessboard, knight to many entries.... Ben Bacarisse <ben.usenet@bsb.me.uk> - 2020-08-12 12:12 +0100
Re: Allowed moves database chessboard, knight to many entries.... Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-08-12 05:13 -0700
Re: Allowed moves database chessboard, knight to many entries.... luserdroog <luser.droog@gmail.com> - 2020-08-12 10:23 -0700
Re: Allowed moves database chessboard, knight to many entries.... Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-08-12 00:50 -0700
Re: Allowed moves database chessboard, knight to many entries.... Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-08-12 01:00 -0700
Re: Allowed moves database chessboard, knight to many entries.... "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2020-08-12 11:58 +0200
Re: Allowed moves database chessboard, knight to many entries.... Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-08-12 05:14 -0700
Re: Allowed moves database chessboard, knight to many entries.... "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2020-08-08 14:44 +0200
Re: Allowed moves database chessboard, knight to many entries.... Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-08-22 08:10 -0700
Re: Allowed moves database chessboard, knight to many entries.... Scott Sauyet <scott@sauyet.com> - 2020-08-25 16:03 -0700
Re: Allowed moves database chessboard, knight to many entries.... Scott Sauyet <scott@sauyet.com> - 2020-08-25 15:06 -0700
csiph-web