tmhglnd / total-serialism

Toolbox full of Algorithmic Composition methods
MIT License
154 stars 11 forks source link

Gen.fill() should accept single array as argument #22

Closed tmhglnd closed 1 year ago

tmhglnd commented 2 years ago

Instead of providing seperate arguments per fill value it should also accept an array and generate from there:

Original with separate arguments

Gen.fill(10, 2, 15, 3, 20, 4);
//=> [ 10, 10, 15, 15, 15, 20, 20, 20, 20 ] 

When using an array it returns [ 0 ]

Gen.fill([10, 20, 2, 15, 3, 20, 4]);
//=> [ 0 ] 

This should actually result in

Gen.fill([10, 20, 2, 15, 3, 20, 4]);
//=> [ 10, 10, 15, 15, 15, 20, 20, 20, 20 ] 
tmhglnd commented 1 year ago

Fixed in 5113ed891ea19dae47cbaf6b044029c0ae6e29d6