Ruby on Rails Tuesday, May 12, 2015

Yeah, thanks. I figured it out. Now I stuck with million other problems, but this is another theme =)

среда, 13 мая 2015 г., 10:36:34 UTC+10 пользователь Scott Ribe написал:
On May 12, 2015, at 5:21 PM, Роман Ярыгин <330...@gmail.com> wrote:
>
> I stuck exactly on recursive algoritm. Can't find out how to build that recursive function

It's recursion, you call it again…

def start
  get_subtree('/')
end

def get_subtree(url)
  #fetch the page
  #parse it
  #for each link
    #normalize the link
    #if link not already visited
      #add link to table of visited links
            get_subtree(link)
   

No comments:

Post a Comment