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


Groups > comp.lang.javascript > #38946

Re: Loop and move within boundary "interval logic for cursored list"

Newsgroups comp.lang.javascript
Date 2020-10-14 02:40 -0700
References (2 earlier) <f6652595-e939-498d-b688-32c2dd6b76b2o@googlegroups.com> <2a301664-d62c-459e-9df9-c0f02e20f208o@googlegroups.com> <3990d6cd-81b1-4a9e-ac00-0508f99c514eo@googlegroups.com> <04b96400-1083-4aad-a123-9e5def8258f7o@googlegroups.com> <bac5a20e-3809-4eda-ab38-22044d94ef2eo@googlegroups.com>
Message-ID <ba08934f-1b99-4f21-824f-e4b4aeb58b56o@googlegroups.com> (permalink)
Subject Re: Loop and move within boundary "interval logic for cursored list"
From Jonas Thörnvall <jonas.thornvall@gmail.com>

Show all headers | View raw


Den onsdag 14 oktober 2020 kl. 11:32:44 UTC+2 skrev Jonas Thörnvall:
> Den onsdag 14 oktober 2020 kl. 05:36:57 UTC+2 skrev luserdroog:
> > On Tuesday, October 13, 2020 at 8:22:59 PM UTC-5, Jonas Thörnvall wrote:
> > 
> > > I think i can see what fuck it up "had to revert to simple solution without full listing" the index of movenumber and moveText.length is not same and that make it nearly impossible to position yourself without changing move forward and backward.
> > > 
> > > The idiots who once decided that first element in an array is zero....
> > > They caused billions of bugs in thousands programming languages.
> > 
> > In APL arrays were originally based on one.
> > Then they made it configurable... and finally settled on mostly zero,
> > but still configurable. 
> > 
> > Zero is common enough that it's probably best to get used to it.
> 
> "I think" i solved it after debugin the variables, i realised it was not the index that fuck up, it was the order i did things.
> 
> function drawTxtMove(){
> 	if (moveText.length>41 && moveNumber>41) {
> 			drawStart=moveNumber-41;
> 			drawLimit=moveNumber;
> 	} else { 
> 			drawStart=0;
> 			if (moveText.length<42){drawLimit=moveText.length; console.log(drawLimit);} else {drawLimit=42;}
> 	}
> 	ctm.fillStyle="#000066";
> 	ctm.fillRect(4,49,350,940);
> 	for (var i=drawStart;i<drawLimit;i++){
> 		if (i % 2 == 0){tColor="white";} else {tColor="black";}
> 		if (i % 2 == 0){bColor="grey";} else {bColor="lightgrey";}	
> 		ctm.fillStyle=bColor;
> 		if(moveNumber-1==i){ctm.fillStyle="orange";}
> 		ctm.fillRect(4,49+tSize,boardPos-116,16);
> 		ctm.fill();
> 		ctm.fillStyle=tColor;
> 		ctm.font = "bold 17px serif";
> 		ctm.fillText(moveText[i], 9, 63+tSize);
> 		tSize=tSize+17;
> 		if(tSize>780){tSize=0;wSize=wSize+58;}
> 		txtLoop=i;
> 	}
> 	tSize=0;
> }

Does the solution look reasonable?

Back to comp.lang.javascript | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Loop and move within boundary "interval logic for cursored list" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-10-13 13:46 -0700
  Re: Loop and move within boundary "interval logic for cursored list" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-10-13 14:01 -0700
  Re: Loop and move within boundary "interval logic for cursored list" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-10-13 14:09 -0700
    Re: Loop and move within boundary "interval logic for cursored list" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-10-13 15:05 -0700
      Re: Loop and move within boundary "interval logic for cursored list" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-10-13 18:07 -0700
        Re: Loop and move within boundary "interval logic for cursored list" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-10-13 18:22 -0700
          Re: Loop and move within boundary "interval logic for cursored list" luserdroog <luser.droog@gmail.com> - 2020-10-13 20:36 -0700
            Re: Loop and move within boundary "interval logic for cursored list" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-10-14 01:34 -0700
              Re: Loop and move within boundary "interval logic for cursored list" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-10-14 01:37 -0700
                Re: Loop and move within boundary "interval logic for cursored list" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-10-14 01:38 -0700
                Re: Loop and move within boundary "interval logic for cursored list" luserdroog <luser.droog@gmail.com> - 2020-10-14 10:51 -0700
                Re: Loop and move within boundary "interval logic for cursored list" John G Harris <niam@jghnorth.org.uk.invalid> - 2020-10-15 18:03 +0100
                Re: Loop and move within boundary "interval logic for cursored list" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-10-16 03:19 -0700
                Re: Loop and move within boundary "interval logic for cursored list" John G Harris <niam@jghnorth.org.uk.invalid> - 2020-10-16 19:30 +0100
                Re: Loop and move within boundary "interval logic for cursored list" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-10-16 12:36 -0700
                Re: Loop and move within boundary "interval logic for cursored list" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-10-16 19:25 -0700
              Re: Loop and move within boundary "interval logic for cursored list" luserdroog <luser.droog@gmail.com> - 2020-10-14 10:32 -0700
            Re: Loop and move within boundary "interval logic for cursored list" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-10-14 02:32 -0700
              Re: Loop and move within boundary "interval logic for cursored list" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-10-14 02:40 -0700
            Re: Loop and move within boundary "interval logic for cursored list" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-10-14 05:05 -0700
              Re: Loop and move within boundary "interval logic for cursored list" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-10-14 05:16 -0700
          Re: Loop and move within boundary "interval logic for cursored list" John G Harris <niam@jghnorth.org.uk.invalid> - 2020-10-15 18:03 +0100
            Re: Loop and move within boundary "interval logic for cursored list" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-10-15 13:05 -0700
              Re: Loop and move within boundary "interval logic for cursored list" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-10-15 14:58 -0700
              Re: Loop and move within boundary "interval logic for cursored list" John G Harris <niam@jghnorth.org.uk.invalid> - 2020-10-16 19:14 +0100
                Re: Loop and move within boundary "interval logic for cursored list" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-10-16 19:23 -0700
                Re: Loop and move within boundary "interval logic for cursored list" "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2020-10-17 11:05 +0200
                Re: Loop and move within boundary "interval logic for cursored list" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-10-17 03:07 -0700
                Re: Loop and move within boundary "interval logic for cursored list" "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2020-10-17 14:47 +0200
                Re: Loop and move within boundary "interval logic for cursored list" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-10-17 05:59 -0700
                Re: Loop and move within boundary "interval logic for cursored list" "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2020-10-17 15:21 +0200
                Re: Loop and move within boundary "interval logic for cursored list" John G Harris <niam@jghnorth.org.uk.invalid> - 2020-10-17 15:09 +0100
                Re: Loop and move within boundary "interval logic for cursored list" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-10-17 11:11 -0700
                Re: Loop and move within boundary "interval logic for cursored list" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-10-19 01:52 -0700
                Re: Loop and move within boundary "interval logic for cursored list" "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2020-10-19 13:37 +0200
                Re: Loop and move within boundary "interval logic for cursored list" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-10-19 05:08 -0700
                Re: Loop and move within boundary "interval logic for cursored list" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-10-19 05:11 -0700
                Re: Loop and move within boundary "interval logic for cursored list" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-10-19 05:52 -0700
                Re: Loop and move within boundary "interval logic for cursored list" "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2020-10-19 19:15 +0200
                Re: Loop and move within boundary "interval logic for cursored list" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-10-19 11:01 -0700
                Re: Loop and move within boundary "interval logic for cursored list" "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2020-10-20 15:30 +0200
                Re: Loop and move within boundary "interval logic for cursored list" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-10-20 07:26 -0700
                Re: Loop and move within boundary "interval logic for cursored list" "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2020-10-21 00:01 +0200
                Re: Loop and move within boundary "interval logic for cursored list" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-10-20 18:19 -0700
                Re: Loop and move within boundary "interval logic for cursored list" "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2020-10-21 13:01 +0200
                Re: Loop and move within boundary "interval logic for cursored list" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-10-21 15:07 -0700
                Re: Loop and move within boundary "interval logic for cursored list" "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2020-10-22 01:21 +0200
                Re: Loop and move within boundary "interval logic for cursored list" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-10-20 07:31 -0700
                Re: Loop and move within boundary "interval logic for cursored list" John G Harris <niam@jghnorth.org.uk.invalid> - 2020-10-19 18:04 +0100
                Re: Loop and move within boundary "interval logic for cursored list" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-10-19 10:47 -0700
                Re: Loop and move within boundary "interval logic for cursored list" John G Harris <niam@jghnorth.org.uk.invalid> - 2020-10-19 19:33 +0100
                Re: Loop and move within boundary "interval logic for cursored list" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-10-19 16:36 -0700
                Re: Loop and move within boundary "interval logic for cursored list" Scott Sauyet <scott@sauyet.com> - 2020-10-20 13:36 -0700

csiph-web