diff options
Diffstat (limited to 'space.js')
-rw-r--r-- | space.js | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -111,14 +111,14 @@ function Space(){ // CLASS } if (match) break;} return loc; } - this.subsection = function(range){ // range is a standard quadruplet + + this.subsection = function(range){ // range is a coordinate pair + // Similarly excludes this.loc newspace = new Space(); - for (let line=0; line<=range[2]-range[0]; line++){ + for (let line=range[0][0]; line<=range[1][0]; line++){ newspace.data.push([]); - for (let chr=0; chr<=range[3]-range[1]; chr++){ - newspace.data[line].push( - this.data[line+range[0]][chr+range[1]] || '' - ); + for (let chr=range[0][1]; chr<=range[1][1]; chr++){ + newspace.data[line-range[0][0]].push(this.data[line][chr] || ''); } } return newspace; |