Slide 43
Slide 43 text
function makeTiledTile(width, height, data) {
const split = 0.7;
const [sWidth, sHeight] = [width*split, height*split];
const newData = {...data, colorIndex:
data.n % 2 === 0 ? data.colorIndex : (data.colorIndex + 1) % data.colors.length };
const big = getTiles(sWidth, sHeight, …, makeCheckerTile, data);
const narrow = getTiles(width-sWidth, sHeight, …, makeCheckerTile, newData);
const wide = getTiles(sWidth, height-sHeight, …, makeCheckerTile, newData);
const small = getTiles(width-sWidth, height-sHeight, …, makeCheckerTile, data);
return [ `${big}
${narrow}
${wide}
${small}`,
data
];}
rotate(getTiles(200, 200, 8, 8, tiledTile, {
colors: ["orange", "hotpink"], colorIndex: 0, n: 5
}))