You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the main file, index.js, the process() function's while loop is able to hang there infinitely if two chain words can only step forward to each other.
Example if foo is only able to go to bar, and if bar is only able to go to foo
foo->bar
bar->foo
having this will result in infinite sentence with alternating of the two words
I've currently not tested if this can happen in larger chains, for example if foo can only go to bar can only go to biz can only go to foo (or if it's even possible)
NOT tested:
foo->bar
bar->biz
biz->foo
my current fix was to simply make a variable that was the previous word, then check if there was only one key for the current word, and if it was equal to the previous word. if it was, then break and return the sentence, if not then continue.
here is the loop with my fix, so far it has worked fine for me and fixed the infinite looping, although I have not extensively tested it:
In the main file, index.js, the process() function's while loop is able to hang there infinitely if two chain words can only step forward to each other.
Example if foo is only able to go to bar, and if bar is only able to go to foo
foo->bar
bar->foo
having this will result in infinite sentence with alternating of the two words
I've currently not tested if this can happen in larger chains, for example if foo can only go to bar can only go to biz can only go to foo (or if it's even possible)
NOT tested:
foo->bar
bar->biz
biz->foo
my current fix was to simply make a variable that was the previous word, then check if there was only one key for the current word, and if it was equal to the previous word. if it was, then break and return the sentence, if not then continue.
here is the loop with my fix, so far it has worked fine for me and fixed the infinite looping, although I have not extensively tested it:
The text was updated successfully, but these errors were encountered: