recursion-tree-visualizer icon indicating copy to clipboard operation
recursion-tree-visualizer copied to clipboard

Feature Request Slow it down!

Open ughstudios opened this issue 4 years ago • 3 comments

https://recursion.now.sh/

I found this on your website. It's a great little tool for visual learners. However, I was curious if there is a way to slow down the visualization or maybe pause it?

ughstudios avatar Mar 09 '21 18:03 ughstudios

At the moment, you can only stop the animation by clicking on the top bar, and then move forward or backward step by step by clicking the arrows.

But I am thinking of implementing a customized option in which the user can define your own pace. Thanks for the request, by the way!

brpapa avatar Mar 09 '21 19:03 brpapa

Hello @brpapa ,

def fn(s:str,i,j,k):
    if i >= len(s):
        if k >= 2:
            return True
        return False
    currNo = 0
    for i in range(i,len(s)):
        currNo = currNo*10 + int(s[i])
        if( j == -1 or (j-currNo) == 1 ):
            if fn(s,i+1,currNo,count+1):
                return True
    return False

Getting error with this code, Can you pls identify what is going wrong , runs fine in IDE ?

fn('1234',0,-1,0)

Error response - Your code outputs the following File "", line 19, in _fn: ''

prashul avatar May 05 '21 22:05 prashul

Hi @prashul,

I improved the error messages. If you run it again you will see that the count var is not defined.

brpapa avatar May 16 '21 00:05 brpapa