Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #32357 > unrolled thread

Logic problem, i always had problem translate until statements into while

Started byjonas.thornvall@gmail.com
First post2017-01-26 10:39 -0800
Last post2017-01-27 13:36 +0100
Articles 16 on this page of 56 — 9 participants

Back to article view | Back to comp.lang.javascript


Contents

  Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-26 10:39 -0800
    Re: Logic problem, i always had problem translate until statements into while Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-01-26 20:28 +0000
      Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-26 13:24 -0800
        Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-26 13:33 -0800
          Re: Logic problem, i always had problem translate until statements into while Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-01-26 23:06 +0000
            Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-27 01:33 -0800
              Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-27 01:57 -0800
                Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-27 02:17 -0800
                  Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-27 02:35 -0800
                    Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-27 02:39 -0800
                      Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-27 02:43 -0800
                    Re: Logic problem, i always had problem translate until statements into while Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-01-27 11:23 +0000
                      Re: Logic problem, i always had problem translate until statements into while Tim Streater <timstreater@greenbee.net> - 2017-01-27 12:14 +0000
                      Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-27 08:00 -0800
                        Re: Logic problem, i always had problem translate until statements into while Gene Wirchenko <genew@telus.net> - 2017-01-27 09:29 -0800
                          Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-27 10:43 -0800
                            Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-27 10:44 -0800
                              Re: Logic problem, i always had problem translate until statements into while Gene Wirchenko <genew@telus.net> - 2017-01-27 15:46 -0800
                                Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-27 18:20 -0800
                                  Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-27 18:34 -0800
                                    Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-27 18:51 -0800
                                    Re: Logic problem, i always had problem translate until statements into while John Harris <niam@jghnorth.org.uk.invalid> - 2017-01-28 10:07 +0000
                                  Re: Logic problem, i always had problem translate until statements into while Gene Wirchenko <genew@telus.net> - 2017-01-30 09:14 -0800
                          Re: Logic problem, i always had problem translate until statements into while "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-01-28 10:48 +0100
                            Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-28 05:05 -0800
                    Re: Logic problem, i always had problem translate until statements into while "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-01-27 13:43 +0100
                    Re: Logic problem, i always had problem translate until statements into while Scott Sauyet <scott.sauyet@gmail.com> - 2017-01-27 19:52 -0800
                      Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-27 22:25 -0800
                      Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-27 22:36 -0800
                        Re: Logic problem, i always had problem translate until statements into while Scott Sauyet <scott.sauyet@gmail.com> - 2017-01-29 18:05 -0800
                          Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-30 09:25 -0800
                          Re: Logic problem, i always had problem translate until statements into while Dr J R Stockton <reply1700@merlyn.demon.co.uk.invalid> - 2017-01-31 23:12 +0000
                            Re: Logic problem, i always had problem translate until statements into while "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-02-01 09:22 +0100
              Re: Logic problem, i always had problem translate until statements into while Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-01-27 11:02 +0000
                Re: Logic problem, i always had problem translate until statements into while Tim Streater <timstreater@greenbee.net> - 2017-01-27 12:11 +0000
                Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-27 07:53 -0800
                  Re: Logic problem, i always had problem translate until statements into while "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-01-27 17:07 +0100
                  Re: Logic problem, i always had problem translate until statements into while Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-01-28 00:55 +0000
                    Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-27 18:14 -0800
                    Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-27 18:15 -0800
                      Re: Logic problem, i always had problem translate until statements into while Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-01-28 15:22 +0000
                        Re: Logic problem, i always had problem translate until statements into while Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-01-28 16:54 +0100
                          Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-28 13:53 -0800
                            Re: Logic problem, i always had problem translate until statements into while Tim Streater <timstreater@greenbee.net> - 2017-01-28 22:13 +0000
                            Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-29 01:27 -0800
                              Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-29 09:41 -0800
                                Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-02-01 08:51 -0800
                                  Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-02-01 09:03 -0800
                                  Re: Logic problem, i always had problem translate until statements into while "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-02-01 19:19 +0100
                                    Re: Logic problem, i always had problem translate until statements into while Tim Streater <timstreater@greenbee.net> - 2017-02-01 18:35 +0000
                                      Re: Logic problem, i always had problem translate until statements into while "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-02-01 19:40 +0100
                                        Re: Logic problem, i always had problem translate until statements into while Tim Streater <timstreater@greenbee.net> - 2017-02-01 19:06 +0000
                                          Re: Logic problem, i always had problem translate until statements into while Tim Streater <timstreater@greenbee.net> - 2017-02-01 19:09 +0000
                                Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-02-01 08:51 -0800
                                  Re: Logic problem, i always had problem translate until statements into while Tim Streater <timstreater@greenbee.net> - 2017-02-01 16:56 +0000
              Re: Logic problem, i always had problem translate until statements into while "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-01-27 13:36 +0100

Page 3 of 3 — ← Prev page 1 2 [3]


#32406

FromBen Bacarisse <ben.usenet@bsb.me.uk>
Date2017-01-28 15:22 +0000
Message-ID<87a8abus4b.fsf@bsb.me.uk>
In reply to#32394
jonas.thornvall@gmail.com writes:

> Den lördag 28 januari 2017 kl. 01:55:14 UTC+1 skrev Ben Bacarisse:
>> jonas.thornvall@gmail.com writes:
>> <snip>
>> > Well the little i know Ben is that null have *no value* yet is defined
>> > "not undefined".
>> 
>> I've cut the rest because I don't see any connection with what went
>> before (but I accept I understand only about 1/4 of your posts).
>> 
>> null is the sole value of the type named Null.  I can't see why you say
>> is has "no value" -- it *is* a value.  But you are right that it is
>> defined.
>> 
>> -- 
>> Ben.
>
> https://en.wikipedia.org/wiki/Null_pointer

And there are loads of other definitions, but this is
comp.lang.javascript so I was talking about null in that context.

-- 
Ben.

[toc] | [prev] | [next] | [standalone]


#32408

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2017-01-28 16:54 +0100
Message-ID<1612792.atdPhlSkOF@PointedEars.de>
In reply to#32406
Ben Bacarisse wrote:

> jonas.thornvall@gmail.com writes:
>> Den lördag 28 januari 2017 kl. 01:55:14 UTC+1 skrev Ben Bacarisse:
>>> jonas.thornvall@gmail.com writes:
>>> <snip>
>>> > Well the little i know Ben is that null have *no value* yet is defined
>>> > "not undefined".
>>> […]
>>> null is the sole value of the type named Null.  I can't see why you say
>>> is has "no value" -- it *is* a value.  But you are right that it is
>>> defined.
>>
>> https://en.wikipedia.org/wiki/Null_pointer
> 
> And there are loads of other definitions, but this is
> comp.lang.javascript so I was talking about null in that context.

OMG.  After all these years he has *still* not acquired the capability
to learn, and to not attempt to preach to the choir.

I am *so* grateful for my newsreader’s scorefile.
 
-- 
PointedEars
FAQ: <http://PointedEars.de/faq> | <http://PointedEars.de/es-matrix>
<https://github.com/PointedEars> | <http://PointedEars.de/wsvn/>
Twitter: @PointedEars2 | Please do not cc me./Bitte keine Kopien per E-Mail.

[toc] | [prev] | [next] | [standalone]


#32409

Fromjonas.thornvall@gmail.com
Date2017-01-28 13:53 -0800
Message-ID<cbf2e308-f5d6-4adf-a4a3-49249ff239f5@googlegroups.com>
In reply to#32408
Den lördag 28 januari 2017 kl. 16:54:24 UTC+1 skrev Thomas 'PointedEars' Lahn:
> Ben Bacarisse wrote:
> 
> > jonas.thornvall@gmail.com writes:
> >> Den lördag 28 januari 2017 kl. 01:55:14 UTC+1 skrev Ben Bacarisse:
> >>> jonas.thornvall@gmail.com writes:
> >>> <snip>
> >>> > Well the little i know Ben is that null have *no value* yet is defined
> >>> > "not undefined".
> >>> […]
> >>> null is the sole value of the type named Null.  I can't see why you say
> >>> is has "no value" -- it *is* a value.  But you are right that it is
> >>> defined.
> >>
> >> https://en.wikipedia.org/wiki/Null_pointer
> > 
> > And there are loads of other definitions, but this is
> > comp.lang.javascript so I was talking about null in that context.
> 
> OMG.  After all these years he has *still* not acquired the capability
> to learn, and to not attempt to preach to the choir.
> 
> I am *so* grateful for my newsreader’s scorefile.
>  
> -- 
> PointedEars
> FAQ: <http://PointedEars.de/faq> | <http://PointedEars.de/es-matrix>
> <https://github.com/PointedEars> | <http://PointedEars.de/wsvn/>
> Twitter: @PointedEars2 | Please do not cc me./Bitte keine Kopien per E-Mail.

I found a solution to my problem that i am quite happy with, for you it may be the obvious solution but for me it took awhile thinking about it. Feel free comment. I just wish i thought of it from start. In all fairness it was some years ago it programmed this type of problem.

funaction a(){
found=false;
param1= document.getElementById('regular').checked; 
param2= document.getElementById('connected').checked)
while (found==false && timeB < stoptime) 
   {
       generate_graph(param1,param2);
   }
}

function generate_graph(){
    arr = makeNodes();
    regular = createLinks(arr);
    if (regular==true) printnode = untangle_links(arr);
    if (connected == param1 && regular == param2)  {found=true;}
    return found;
}

   


[toc] | [prev] | [next] | [standalone]


#32410

FromTim Streater <timstreater@greenbee.net>
Date2017-01-28 22:13 +0000
Message-ID<280120172213455166%timstreater@greenbee.net>
In reply to#32409
In article <cbf2e308-f5d6-4adf-a4a3-49249ff239f5@googlegroups.com>,
<jonas.thornvall@gmail.com> wrote:

>I found a solution to my problem that i am quite happy with, for you it may be
>the obvious solution but for me it took awhile thinking about it. Feel free
>comment. I just wish i thought of it from start. In all fairness it was some
>years ago it programmed this type of problem.
>
>funaction a(){
>found=false;
>param1= document.getElementById('regular').checked; 
>param2= document.getElementById('connected').checked)
>while (found==false && timeB < stoptime) 
>   {
>       generate_graph(param1,param2);
>   }
>}
>
>function generate_graph(){
>    arr = makeNodes();
>    regular = createLinks(arr);
>    if (regular==true) printnode = untangle_links(arr);
>    if (connected == param1 && regular == param2)  {found=true;}
>    return found;
>}

Your:

  return found;

statement serves no purpose.

-- 
"Once you adopt the unix paradigm, the variants cease to be a problem - you
bitch, of course, but that's because bitching is fun, unlike M$ OS's, where 
bitching is required to keep your head from exploding." - S Stremler in afc

[toc] | [prev] | [next] | [standalone]


#32413

Fromjonas.thornvall@gmail.com
Date2017-01-29 01:27 -0800
Message-ID<b5537f24-a5ed-4801-b2e3-38e2e09d8bc2@googlegroups.com>
In reply to#32409
Den lördag 28 januari 2017 kl. 22:53:09 UTC+1 skrev jonas.t...@gmail.com:
> Den lördag 28 januari 2017 kl. 16:54:24 UTC+1 skrev Thomas 'PointedEars' Lahn:
> > Ben Bacarisse wrote:
> > 
> > > jonas.thornvall@gmail.com writes:
> > >> Den lördag 28 januari 2017 kl. 01:55:14 UTC+1 skrev Ben Bacarisse:
> > >>> jonas.thornvall@gmail.com writes:
> > >>> <snip>
> > >>> > Well the little i know Ben is that null have *no value* yet is defined
> > >>> > "not undefined".
> > >>> […]
> > >>> null is the sole value of the type named Null.  I can't see why you say
> > >>> is has "no value" -- it *is* a value.  But you are right that it is
> > >>> defined.
> > >>
> > >> https://en.wikipedia.org/wiki/Null_pointer
> > > 
> > > And there are loads of other definitions, but this is
> > > comp.lang.javascript so I was talking about null in that context.
> > 
> > OMG.  After all these years he has *still* not acquired the capability
> > to learn, and to not attempt to preach to the choir.
> > 
> > I am *so* grateful for my newsreader’s scorefile.
> >  
> > -- 
> > PointedEars
> > FAQ: <http://PointedEars.de/faq> | <http://PointedEars.de/es-matrix>
> > <https://github.com/PointedEars> | <http://PointedEars.de/wsvn/>
> > Twitter: @PointedEars2 | Please do not cc me./Bitte keine Kopien per E-Mail.
> 
> I found a solution to my problem that i am quite happy with, for you it may be the obvious solution but for me it took awhile thinking about it. Feel free comment. I just wish i thought of it from start. In all fairness it was some years ago it programmed this type of problem.
> 
> funaction a(){
> found=false;
> param1= document.getElementById('regular').checked; 
> param2= document.getElementById('connected').checked)
> while (found==false && timeB < stoptime) 
>    {
>        generate_graph(param1,param2);
>    }
> }
> 
> function generate_graph(){
>     arr = makeNodes();
>     regular = createLinks(arr);
>     if (regular==true) printnode = untangle_links(arr);
>     if (connected == param1 && regular == param2)  {found=true;}
>     return found;
> }

It also has the advantage you can add further parmeters with very small modification, well i like it.

[toc] | [prev] | [next] | [standalone]


#32420

Fromjonas.thornvall@gmail.com
Date2017-01-29 09:41 -0800
Message-ID<1dbcb59b-d06e-4519-a9da-e84aa9826a40@googlegroups.com>
In reply to#32413
Den söndag 29 januari 2017 kl. 10:27:34 UTC+1 skrev jonas.t...@gmail.com:
> Den lördag 28 januari 2017 kl. 22:53:09 UTC+1 skrev jonas.t...@gmail.com:
> > Den lördag 28 januari 2017 kl. 16:54:24 UTC+1 skrev Thomas 'PointedEars' Lahn:
> > > Ben Bacarisse wrote:
> > > 
> > > > jonas.thornvall@gmail.com writes:
> > > >> Den lördag 28 januari 2017 kl. 01:55:14 UTC+1 skrev Ben Bacarisse:
> > > >>> jonas.thornvall@gmail.com writes:
> > > >>> <snip>
> > > >>> > Well the little i know Ben is that null have *no value* yet is defined
> > > >>> > "not undefined".
> > > >>> […]
> > > >>> null is the sole value of the type named Null.  I can't see why you say
> > > >>> is has "no value" -- it *is* a value.  But you are right that it is
> > > >>> defined.
> > > >>
> > > >> https://en.wikipedia.org/wiki/Null_pointer
> > > > 
> > > > And there are loads of other definitions, but this is
> > > > comp.lang.javascript so I was talking about null in that context.
> > > 
> > > OMG.  After all these years he has *still* not acquired the capability
> > > to learn, and to not attempt to preach to the choir.
> > > 
> > > I am *so* grateful for my newsreader’s scorefile.
> > >  
> > > -- 
> > > PointedEars
> > > FAQ: <http://PointedEars.de/faq> | <http://PointedEars.de/es-matrix>
> > > <https://github.com/PointedEars> | <http://PointedEars.de/wsvn/>
> > > Twitter: @PointedEars2 | Please do not cc me./Bitte keine Kopien per E-Mail.
> > 
> > I found a solution to my problem that i am quite happy with, for you it may be the obvious solution but for me it took awhile thinking about it. Feel free comment. I just wish i thought of it from start. In all fairness it was some years ago it programmed this type of problem.
> > 
> > funaction a(){
> > found=false;
> > param1= document.getElementById('regular').checked; 
> > param2= document.getElementById('connected').checked)
> > while (found==false && timeB < stoptime) 
> >    {
> >        generate_graph(param1,param2);
> >    }
> > }
> > 
> > function generate_graph(){
> >     arr = makeNodes();
> >     regular = createLinks(arr);
> >     if (regular==true) printnode = untangle_links(arr);
> >     if (connected == param1 && regular == param2)  {found=true;}
> >     return found;
> > }
> 
> It also has the advantage you can add further parmeters with very small modification, well i like it.

I probably should move the loop to the generator function.

[toc] | [prev] | [next] | [standalone]


#32433

Fromjonas.thornvall@gmail.com
Date2017-02-01 08:51 -0800
Message-ID<fd8417c9-f34f-4d23-809b-0bc0d388c9ae@googlegroups.com>
In reply to#32420
Den söndag 29 januari 2017 kl. 18:41:32 UTC+1 skrev jonas.t...@gmail.com:
> Den söndag 29 januari 2017 kl. 10:27:34 UTC+1 skrev jonas.t...@gmail.com:
> > Den lördag 28 januari 2017 kl. 22:53:09 UTC+1 skrev jonas.t...@gmail.com:
> > > Den lördag 28 januari 2017 kl. 16:54:24 UTC+1 skrev Thomas 'PointedEars' Lahn:
> > > > Ben Bacarisse wrote:
> > > > 
> > > > > jonas.thornvall@gmail.com writes:
> > > > >> Den lördag 28 januari 2017 kl. 01:55:14 UTC+1 skrev Ben Bacarisse:
> > > > >>> jonas.thornvall@gmail.com writes:
> > > > >>> <snip>
> > > > >>> > Well the little i know Ben is that null have *no value* yet is defined
> > > > >>> > "not undefined".
> > > > >>> […]
> > > > >>> null is the sole value of the type named Null.  I can't see why you say
> > > > >>> is has "no value" -- it *is* a value.  But you are right that it is
> > > > >>> defined.
> > > > >>
> > > > >> https://en.wikipedia.org/wiki/Null_pointer
> > > > > 
> > > > > And there are loads of other definitions, but this is
> > > > > comp.lang.javascript so I was talking about null in that context.
> > > > 
> > > > OMG.  After all these years he has *still* not acquired the capability
> > > > to learn, and to not attempt to preach to the choir.
> > > > 
> > > > I am *so* grateful for my newsreader’s scorefile.
> > > >  
> > > > -- 
> > > > PointedEars
> > > > FAQ: <http://PointedEars.de/faq> | <http://PointedEars.de/es-matrix>
> > > > <https://github.com/PointedEars> | <http://PointedEars.de/wsvn/>
> > > > Twitter: @PointedEars2 | Please do not cc me./Bitte keine Kopien per E-Mail.
> > > 
> > > I found a solution to my problem that i am quite happy with, for you it may be the obvious solution but for me it took awhile thinking about it. Feel free comment. I just wish i thought of it from start. In all fairness it was some years ago it programmed this type of problem.
> > > 
> > > funaction a(){
> > > found=false;
> > > param1= document.getElementById('regular').checked; 
> > > param2= document.getElementById('connected').checked)
> > > while (found==false && timeB < stoptime) 
> > >    {
> > >        generate_graph(param1,param2);
> > >    }
> > > }
> > > 
> > > function generate_graph(){
> > >     arr = makeNodes();
> > >     regular = createLinks(arr);
> > >     if (regular==true) printnode = untangle_links(arr);
> > >     if (connected == param1 && regular == param2)  {found=true;}
> > >     return found;
> > > }
> > 
> > It also has the advantage you can add further parmeters with very small modification, well i like it.
> 
> I probably should move the loop to the generator function.

Of course i would prefered have this variant working in Javascript, i simply think it is more straightforward. While found==false do not quite do it for me.

What is your view about this solution?

funaction a(){ 
param1= document.getElementById('regular').checked; 
param2= document.getElementById('connected').checked) 
generate_graph(param1,param2); 
} 

function generate_graph(){ 
var found=false; 
do until (found==true && timeB < stoptime) 
   { 
    arr = makeNodes(); 
    regular = createLinks(arr); 
    if (regular==true) printnode = untangle_links(arr); 
    if (connected == param2 && regular == param1)  {found=true;} 
    return found; 
   } 
}

[toc] | [prev] | [next] | [standalone]


#32436

Fromjonas.thornvall@gmail.com
Date2017-02-01 09:03 -0800
Message-ID<7380c38a-b48e-49ff-9bd5-422847a38bcd@googlegroups.com>
In reply to#32433
Den onsdag 1 februari 2017 kl. 17:51:16 UTC+1 skrev jonas.t...@gmail.com:
> Den söndag 29 januari 2017 kl. 18:41:32 UTC+1 skrev jonas.t...@gmail.com:
> > Den söndag 29 januari 2017 kl. 10:27:34 UTC+1 skrev jonas.t...@gmail.com:
> > > Den lördag 28 januari 2017 kl. 22:53:09 UTC+1 skrev jonas.t...@gmail.com:
> > > > Den lördag 28 januari 2017 kl. 16:54:24 UTC+1 skrev Thomas 'PointedEars' Lahn:
> > > > > Ben Bacarisse wrote:
> > > > > 
> > > > > > jonas.thornvall@gmail.com writes:
> > > > > >> Den lördag 28 januari 2017 kl. 01:55:14 UTC+1 skrev Ben Bacarisse:
> > > > > >>> jonas.thornvall@gmail.com writes:
> > > > > >>> <snip>
> > > > > >>> > Well the little i know Ben is that null have *no value* yet is defined
> > > > > >>> > "not undefined".
> > > > > >>> […]
> > > > > >>> null is the sole value of the type named Null.  I can't see why you say
> > > > > >>> is has "no value" -- it *is* a value.  But you are right that it is
> > > > > >>> defined.
> > > > > >>
> > > > > >> https://en.wikipedia.org/wiki/Null_pointer
> > > > > > 
> > > > > > And there are loads of other definitions, but this is
> > > > > > comp.lang.javascript so I was talking about null in that context.
> > > > > 
> > > > > OMG.  After all these years he has *still* not acquired the capability
> > > > > to learn, and to not attempt to preach to the choir.
> > > > > 
> > > > > I am *so* grateful for my newsreader’s scorefile.
> > > > >  
> > > > > -- 
> > > > > PointedEars
> > > > > FAQ: <http://PointedEars.de/faq> | <http://PointedEars.de/es-matrix>
> > > > > <https://github.com/PointedEars> | <http://PointedEars.de/wsvn/>
> > > > > Twitter: @PointedEars2 | Please do not cc me./Bitte keine Kopien per E-Mail.
> > > > 
> > > > I found a solution to my problem that i am quite happy with, for you it may be the obvious solution but for me it took awhile thinking about it. Feel free comment. I just wish i thought of it from start. In all fairness it was some years ago it programmed this type of problem.
> > > > 
> > > > funaction a(){
> > > > found=false;
> > > > param1= document.getElementById('regular').checked; 
> > > > param2= document.getElementById('connected').checked)
> > > > while (found==false && timeB < stoptime) 
> > > >    {
> > > >        generate_graph(param1,param2);
> > > >    }
> > > > }
> > > > 
> > > > function generate_graph(){
> > > >     arr = makeNodes();
> > > >     regular = createLinks(arr);
> > > >     if (regular==true) printnode = untangle_links(arr);
> > > >     if (connected == param1 && regular == param2)  {found=true;}
> > > >     return found;
> > > > }
> > > 
> > > It also has the advantage you can add further parmeters with very small modification, well i like it.
> > 
> > I probably should move the loop to the generator function.
> 
> Of course i would prefered have this variant working in Javascript, i simply think it is more straightforward. While found==false do not quite do it for me.
> 
> What is your view about this solution?
> 
> funaction a(){ 
> param1= document.getElementById('regular').checked; 
> param2= document.getElementById('connected').checked) 
> generate_graph(param1,param2); 
> } 
> 
> function generate_graph(){ 
> var found=false; 
> do until (found==true && timeB < stoptime) 
>    { 
>     arr = makeNodes(); 
>     regular = createLinks(arr); 
>     if (regular==true) printnode = untangle_links(arr); 
>     if (connected == param2 && regular == param1)  {found=true;} 
>     return found; 
>    } 
> }

This type of phrasing/statement probably resemble abit how most people think. You have an assumption or looking for something that you do not know the answer to, and you try things as long it seem meaningful.

[toc] | [prev] | [next] | [standalone]


#32437

From"Evertjan." <exxjxw.hannivoort@inter.nl.net>
Date2017-02-01 19:19 +0100
Message-ID<XnsA70FC483D368Feejj99@194.109.6.166>
In reply to#32433
jonas.thornvall@gmail.com wrote on 01 Feb 2017 in comp.lang.javascript:

> What is your view about this solution?

This is terrible bad programming

> funaction a(){ 
> param1= document.getElementById('regular').checked; 
> param2= document.getElementById('connected').checked) 

Unmatched ')' error

> generate_graph(param1,param2); 
>} 
> 
> function generate_graph(){ 
> var found=false; 
> do until (found==true && timeB < stoptime) 

you exit the statement at 'return' without using the loop.

>    { 
>     arr = makeNodes(); 


>     regular = createLinks(arr); 
>     if (regular==true) printnode = untangle_links(arr); 

use:

if (createLinks(arr)) printnode = untangle_links(arr);

>     if (connected == param2 && regular == param1)  {found=true;} 
>     return found; 

use:

return connected == param2 && regular == param1;


>    } 
>}
> 



-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

[toc] | [prev] | [next] | [standalone]


#32438

FromTim Streater <timstreater@greenbee.net>
Date2017-02-01 18:35 +0000
Message-ID<010220171835335910%timstreater@greenbee.net>
In reply to#32437
In article <XnsA70FC483D368Feejj99@194.109.6.166>, Evertjan.
<exxjxw.hannivoort@inter.nl.net> wrote:

>jonas.thornvall@gmail.com wrote on 01 Feb 2017 in comp.lang.javascript:

>>     if (connected == param2 && regular == param1)  {found=true;} 
>>     return found; 
>
>use:
>
>return connected == param2 && regular == param1;

This is not needed as he does not use the returned value.

-- 
Anyone who slaps a 'this page is best viewed with Browser X' label on
a Web page appears to be yearning for the bad old days, before the Web,
when you had very little chance of reading a document written on another
computer, another word processor, or another network. -- Tim Berners-Lee

[toc] | [prev] | [next] | [standalone]


#32439

From"Evertjan." <exxjxw.hannivoort@inter.nl.net>
Date2017-02-01 19:40 +0100
Message-ID<XnsA70FC8256AFF8eejj99@194.109.6.166>
In reply to#32438
Tim Streater <timstreater@greenbee.net> wrote on 01 Feb 2017 in 
comp.lang.javascript:

> In article <XnsA70FC483D368Feejj99@194.109.6.166>, Evertjan.
> <exxjxw.hannivoort@inter.nl.net> wrote:
> 
>>jonas.thornvall@gmail.com wrote on 01 Feb 2017 in comp.lang.javascript:
> 
>>>     if (connected == param2 && regular == param1)  {found=true;} 
>>>     return found; 
>>
>>use:
>>
>>return connected == param2 && regular == param1;
> 
> This is not needed as he does not use the returned value.

I have no idea what the definition of "use" is in Jonasses case,
as he mainy just answers himself.



-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

[toc] | [prev] | [next] | [standalone]


#32440

FromTim Streater <timstreater@greenbee.net>
Date2017-02-01 19:06 +0000
Message-ID<010220171906407887%timstreater@greenbee.net>
In reply to#32439
In article <XnsA70FC8256AFF8eejj99@194.109.6.166>, Evertjan.
<exxjxw.hannivoort@inter.nl.net> wrote:

>Tim Streater <timstreater@greenbee.net> wrote on 01 Feb 2017 in 
>comp.lang.javascript:
>
>> In article <XnsA70FC483D368Feejj99@194.109.6.166>, Evertjan.
>> <exxjxw.hannivoort@inter.nl.net> wrote:
>> 
>>>jonas.thornvall@gmail.com wrote on 01 Feb 2017 in comp.lang.javascript:
>> 
>>>>     if (connected == param2 && regular == param1)  {found=true;} 
>>>>     return found; 
>>>
>>>use:
>>>
>>>return connected == param2 && regular == param1;
>> 
>> This is not needed as he does not use the returned value.
>
>I have no idea what the definition of "use" is in Jonas' case,
>as he mainly just answers himself.

Upthread he has this:

generate_graph(param1,param2); 
} 
 
function generate_graph(){ ...

so as I say, he is not using the returned value. Thus, the
return-with-value is unnecessary.

-- 
There's no obfuscated Perl contest because it's pointless.

- Jeff Polk

[toc] | [prev] | [next] | [standalone]


#32441

FromTim Streater <timstreater@greenbee.net>
Date2017-02-01 19:09 +0000
Message-ID<010220171909277917%timstreater@greenbee.net>
In reply to#32440
In article <010220171906407887%timstreater@greenbee.net>, Tim Streater
<timstreater@greenbee.net> wrote:

>In article <XnsA70FC8256AFF8eejj99@194.109.6.166>, Evertjan.
><exxjxw.hannivoort@inter.nl.net> wrote:
>
>>Tim Streater <timstreater@greenbee.net> wrote on 01 Feb 2017 in 
>>comp.lang.javascript:
>>
>>> In article <XnsA70FC483D368Feejj99@194.109.6.166>, Evertjan.
>>> <exxjxw.hannivoort@inter.nl.net> wrote:
>>> 
>>>>jonas.thornvall@gmail.com wrote on 01 Feb 2017 in comp.lang.javascript:
>>> 
>>>>>     if (connected == param2 && regular == param1)  {found=true;} 
>>>>>     return found; 
>>>>
>>>>use:
>>>>
>>>>return connected == param2 && regular == param1;
>>> 
>>> This is not needed as he does not use the returned value.
>>
>>I have no idea what the definition of "use" is in Jonas' case,
>>as he mainly just answers himself.
>
>Upthread he has this:
>
>generate_graph(param1,param2); 
>} 
> 
>function generate_graph(){ ...
>
>so as I say, he is not using the returned value. Thus, the
>return-with-value is unnecessary.

Actually it's worse than that. He's not even managing to pass
parameters through.

-- 
HAL 9000:    Dave.  Put down those Windows disks.  Dave.  DAVE!

[toc] | [prev] | [next] | [standalone]


#32434

Fromjonas.thornvall@gmail.com
Date2017-02-01 08:51 -0800
Message-ID<62ef7ba0-faf5-4fe1-a65f-ba1c8f200637@googlegroups.com>
In reply to#32420
Den söndag 29 januari 2017 kl. 18:41:32 UTC+1 skrev jonas.t...@gmail.com:
> Den söndag 29 januari 2017 kl. 10:27:34 UTC+1 skrev jonas.t...@gmail.com:
> > Den lördag 28 januari 2017 kl. 22:53:09 UTC+1 skrev jonas.t...@gmail.com:
> > > Den lördag 28 januari 2017 kl. 16:54:24 UTC+1 skrev Thomas 'PointedEars' Lahn:
> > > > Ben Bacarisse wrote:
> > > > 
> > > > > jonas.thornvall@gmail.com writes:
> > > > >> Den lördag 28 januari 2017 kl. 01:55:14 UTC+1 skrev Ben Bacarisse:
> > > > >>> jonas.thornvall@gmail.com writes:
> > > > >>> <snip>
> > > > >>> > Well the little i know Ben is that null have *no value* yet is defined
> > > > >>> > "not undefined".
> > > > >>> […]
> > > > >>> null is the sole value of the type named Null.  I can't see why you say
> > > > >>> is has "no value" -- it *is* a value.  But you are right that it is
> > > > >>> defined.
> > > > >>
> > > > >> https://en.wikipedia.org/wiki/Null_pointer
> > > > > 
> > > > > And there are loads of other definitions, but this is
> > > > > comp.lang.javascript so I was talking about null in that context.
> > > > 
> > > > OMG.  After all these years he has *still* not acquired the capability
> > > > to learn, and to not attempt to preach to the choir.
> > > > 
> > > > I am *so* grateful for my newsreader’s scorefile.
> > > >  
> > > > -- 
> > > > PointedEars
> > > > FAQ: <http://PointedEars.de/faq> | <http://PointedEars.de/es-matrix>
> > > > <https://github.com/PointedEars> | <http://PointedEars.de/wsvn/>
> > > > Twitter: @PointedEars2 | Please do not cc me./Bitte keine Kopien per E-Mail.
> > > 
> > > I found a solution to my problem that i am quite happy with, for you it may be the obvious solution but for me it took awhile thinking about it. Feel free comment. I just wish i thought of it from start. In all fairness it was some years ago it programmed this type of problem.
> > > 
> > > funaction a(){
> > > found=false;
> > > param1= document.getElementById('regular').checked; 
> > > param2= document.getElementById('connected').checked)
> > > while (found==false && timeB < stoptime) 
> > >    {
> > >        generate_graph(param1,param2);
> > >    }
> > > }
> > > 
> > > function generate_graph(){
> > >     arr = makeNodes();
> > >     regular = createLinks(arr);
> > >     if (regular==true) printnode = untangle_links(arr);
> > >     if (connected == param1 && regular == param2)  {found=true;}
> > >     return found;
> > > }
> > 
> > It also has the advantage you can add further parmeters with very small modification, well i like it.
> 
> I probably should move the loop to the generator function.

Of course i would prefered have this variant working in Javascript, i simply think it is more straightforward. While found==false do not quite do it for me.

What is your view about this solution?

funaction a(){ 
param1= document.getElementById('regular').checked; 
param2= document.getElementById('connected').checked) 
generate_graph(param1,param2); 
} 

function generate_graph(){ 
var found=false; 
do until (found==true && timeB < stoptime) 
   { 
    arr = makeNodes(); 
    regular = createLinks(arr); 
    if (regular==true) printnode = untangle_links(arr); 
    if (connected == param2 && regular == param1)  {found=true;} 
    return found; 
   } 
}

[toc] | [prev] | [next] | [standalone]


#32435

FromTim Streater <timstreater@greenbee.net>
Date2017-02-01 16:56 +0000
Message-ID<010220171656550806%timstreater@greenbee.net>
In reply to#32434
In article <62ef7ba0-faf5-4fe1-a65f-ba1c8f200637@googlegroups.com>,
<jonas.thornvall@gmail.com> wrote:

>What is your view about this solution?
>
>funaction a(){ 
>param1= document.getElementById('regular').checked; 
>param2= document.getElementById('connected').checked) 
>generate_graph(param1,param2); 
>} 
>
>function generate_graph(){ 
>var found=false; 
>do until (found==true && timeB < stoptime) 
>   { 
>    arr = makeNodes(); 
>    regular = createLinks(arr); 
>    if (regular==true) printnode = untangle_links(arr); 
>    if (connected == param2 && regular == param1)  {found=true;} 
>    return found; 
>   } 
>}

You don't need found at all, or the loop. This does the same:

function generate_graph(){ 

    arr = makeNodes(); 
    regular = createLinks(arr); 
    if (regular==true) printnode = untangle_links(arr); 

}

-- 
Anyone who slaps a 'this page is best viewed with Browser X' label on
a Web page appears to be yearning for the bad old days, before the Web,
when you had very little chance of reading a document written on another
computer, another word processor, or another network. -- Tim Berners-Lee

[toc] | [prev] | [next] | [standalone]


#32380

From"Evertjan." <exxjxw.hannivoort@inter.nl.net>
Date2017-01-27 13:36 +0100
Message-ID<XnsA70A8A83DA40Beejj99@194.109.6.166>
In reply to#32366
jonas.thornvall@gmail.com wrote on 27 Jan 2017 in comp.lang.javascript:

> can i set the boolean to "null" at start? 

It would NOT be a boolean variable, so NO!

-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

[toc] | [prev] | [standalone]


Page 3 of 3 — ← Prev page 1 2 [3]

Back to top | Article view | comp.lang.javascript


csiph-web