diff options
author | Holden Rohrer <holden.rohrer@gmail.com> | 2019-12-27 14:40:21 -0500 |
---|---|---|
committer | Holden Rohrer <holden.rohrer@gmail.com> | 2019-12-27 14:40:21 -0500 |
commit | 8921cc0d825981ab79f9f0d3b9d19d08d5d1677e (patch) | |
tree | 915967843dd16d5fa5db559be40c2cbb6912ba77 | |
parent | 8810c883ff3b0b5709b9d7fb78e70ecec7211e94 (diff) |
moved space.print
-rw-r--r-- | space.js | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -62,6 +62,11 @@ function Space(){ this.tofile = function(filename){ fs.writeFileSync(filename, this.print()); }; + + this.print = function(){ + return this.data.map(row => replace(replace(replace(row,'&','\\&'),'\\','\\\\'),'','&').join('')).join('\n'); + } + this.fromfile = function(filename){ //Reads an external file into internal data this.adhoc(fs.readFileSync(filename,'utf8')); } @@ -77,9 +82,6 @@ function Space(){ return row; }); } - this.print = function(){ - return this.data.map(row => replace(replace(replace(row,'&','\\&'),'\\','\\\\'),'','&').join('')).join('\n'); - } this.comb = function(other, func, offset){ // Convert negative offsets of either sort into zero offsets with significant previous whitespace (translation) for (let i = 0; i < -offset[0]; i++) this.data.unshift([]); |