Advertisement
Guest User

sanakirja

a guest
Mar 24th, 2014
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.21 KB | None | 0 0
  1. var dictionary = Map[String,String]().withDefaultValue("ei löytynyt")
  2. Source.fromFile(new File("italia.txt")).getLines().grouped(2).foreach(s => dictionary += (s(0) -> s(1)))
  3. while(true) println(dictionary(readLine))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement