SHARE
TWEET

smaller scala

a guest Jan 17th, 2014 86 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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)))
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top