progs/app3.scala
changeset 96 9fcd3de53c06
parent 93 4794759139ea
child 97 60a3ba90dd53
equal deleted inserted replaced
95:dbe49327b6c5 96:9fcd3de53c06
     2 
     2 
     3 def crawl(url: String, n: Int) : Unit = {
     3 def crawl(url: String, n: Int) : Unit = {
     4   if (n == 0) ()
     4   if (n == 0) ()
     5   else if (my_urls.findFirstIn(url) == None) ()
     5   else if (my_urls.findFirstIn(url) == None) ()
     6   else {
     6   else {
     7     println("Visiting: " + n + " " + url)
     7     println(s"Visiting: $n $url")
     8     for (u <- get_all_URLs(get_page(url))) crawl(u, n - 1)
     8     for (u <- get_all_URLs(get_page(url))) crawl(u, n - 1)
     9   }
     9   }
    10 }
    10 }