Advertisement
Guest User

smaller scala

a guest
Jan 17th, 2014
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.28 KB | None | 0 0
  1. def x(s: Any) = {
  2.   println(s)
  3.   s match {
  4.     case "Philosophy" => 1;
  5.     case _ => x(("<p>.*?\"/wiki/([^:]*?)\".*?</p>").r.findFirstMatchIn(scala.io.Source.fromURL("http://en.wikipedia.org/wiki/" + s).getLines.mkString).map(_ group 1).mkString) + 1
  6.   }
  7. }
  8. println(x(args(0)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement