Skip to content

Instantly share code, notes, and snippets.

Avatar

Javi Mollà javimolla

View GitHub Profile
@javimolla
javimolla / test.scala
Created Feb 13, 2015
Read quotes and print one randomly
View test.scala
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 != "") {
You can’t perform that action at this time.