deohgu / deohgu/wave-function-collapse-js

Refactor`picksRandomIdentity.js`

Open
#12 0 comments 0 reactions 0 assignees View on GitHub
low-priority refactoring
Dominant language
JavaScript
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

## Description
Make the algorithm easier to read and more efficient if necessary.

## Ideas
- Consider using an Array.reduce() to carry the previous result after each iteration instead of keeping the number outside of the function. [Short explanation of .reduce()](https://redux.js.org/tutorials/essentials/part-1-overview-concepts#:~:text=The%20Array.reduce()%20method%20lets%20you%20take%20an%20array%20of%20values%2C%20process%20each%20item%20in%20the%20array%20one%20at%20a%20time%2C%20and%20return%20a%20single%20final%20result.%20You%20can%20think%20of%20it%20as%20%22reducing%20the%20array%20down%20to%20one%20value%22.).

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.