Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You're off by one in the initial seed step. Change

for (let i = seedSteps + s.length; i >= seedSteps; i--) to for (let i = seedSteps + s.length - 1; i >= seedSteps; i--)

The original is not using the for loop in the usual way so i starts off one smaller than expected.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: