progs/app2.scala
changeset 97 60a3ba90dd53
parent 96 9fcd3de53c06
child 254 dcd4688690ce
equal deleted inserted replaced
96:9fcd3de53c06 97:60a3ba90dd53
     8 
     8 
     9 def crawl(url: String, n: Int) : Unit = {
     9 def crawl(url: String, n: Int) : Unit = {
    10   if (n == 0) ()
    10   if (n == 0) ()
    11   else {
    11   else {
    12     println(s"Visiting: $n $url")
    12     println(s"Visiting: $n $url")
    13     for (u <- get_all_URLs(get_page(url))) crawl(u, n - 1)
    13     for (u <- get_all_URLs(get_page(url))) 
       
    14       crawl(u, n - 1)
    14   }
    15   }
    15 }
    16 }
    16 
    17