diff options
-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([]); |