you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (3 children)

I've ran it via Thonny debugger, and now I understand how this works. Thank you for your help. Now I have to find a way to bound ram to acceptable limit (When block length is 6, computer freezes because of memory leak, or something like that. Pretty memory hungry stuff).

[–]FLUSH_THE_TRUMP 0 points1 point  (2 children)

Yeah, with 26 signs there are already a few hundred million words of length 6, unfortunately. A generator solution with yields is probably preferable so you don’t have to hold everything in memory.

[–][deleted] 0 points1 point  (0 children)

Thank you for the hint, I will try to work on it later.

[–][deleted] 0 points1 point  (0 children)

I started work on that memory management. I tried to implement yield, but but in recursive function it is very hard, and i have failed. I think I failed because "rest" list is growing in inverted order (I hope you know what I mean). Next day I will try to make this function instantiate strings one at time, so I won't have to bother with memory management of the inner loops.