Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

b.shuffle() #79

Open
trych opened this issue Jul 25, 2016 · 3 comments
Open

b.shuffle() #79

trych opened this issue Jul 25, 2016 · 3 comments

Comments

@trych
Copy link
Contributor

trych commented Jul 25, 2016

I think a b.shuffle() function would be useful, that could shuffle both collections or simple arrays. I remember in my first basil.js project I needed a lot of shuffling of collections and my classmates were in the same situation. I ended up using a Fisher-Yates shuffle, but as I was a bloody beginner I had a lot of trouble implementing it.

So it would be nice to have a simple b.shuffle({collection|array}) method.

Any thoughts?

Please flag as feature request.

@ff6347
Copy link
Member

ff6347 commented Nov 11, 2016

@b-g @ffd8 any thoughts on this?

@b-g
Copy link
Member

b-g commented Nov 11, 2016

I personally don't need this. Feels not very basil related but rather a js array feature. I would rather point people to use underscore.js ... for such things. But I won't veto if the rest is very keen on it.

@trych
Copy link
Contributor Author

trych commented Nov 11, 2016

If there were a standard js function for shuffling an array, then we wouldn't need it. But it is a bit more involved to do a proper shuffle, so I think it would be helpful. In the context how basil is used at our school the need to shuffle stuff came up a few times.

Btw., just checked and p5.js has a whole bunch of array functions, including shuffle().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants