Skip to content

Instantly share code, notes, and snippets.

View javimolla's full-sized avatar

Javi Mollà javimolla

  • Qinshift
  • Valencia
View GitHub Profile
@javimolla
javimolla / test.scala
Created February 13, 2015 13:49
Read quotes and print one randomly
import scala.collection.mutable.ArrayBuffer
import util.Random.nextInt
object test extends App {
val source = scala.io.Source.fromFile("/path/to/quotes.txt")
val quotes = new ArrayBuffer[String]()
var current = ""
for (line <- source.getLines) {
if (line != "") {