blob: 5200fd858ef38935f940afc7ad2e3907d2c26122 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
// Tests space.comb()
const Space = require('../space');
newspace = new Space();
newspace.adhoc('\
line1\n\
&&&&transparency&&&&\n\
\n\
afterempty\n')
empty = new Space();
otherspace = new Space();
otherspace.adhoc('\
&&&transparency&&&\n\
testline');
function add(char1,char2){
if (char1 == '') return char2;
else return char1;
}
otherspace.comb(newspace, add, [0,0]);
empty.comb(otherspace, add, [0,0]);
empty.comb(otherspace, add, [8,0]);
//console.log(otherspace.print());
console.log(empty.print()); // Should be equal to otherspace slightly displaced
|