Skip to content

Commit

Permalink
names.txtから名前を読み込んで出力する
Browse files Browse the repository at this point in the history
  • Loading branch information
Kuchitama committed Sep 21, 2014
1 parent 5858ce2 commit 173a1cf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/scala/com/example/NameSelector.scala
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package com.example

import scala.util.Random
import scalax.file.Path

object NameSelector {
lazy val names = List("aa7th", "ryu1_okd", "mumoshu")
lazy val namesFile:Path = Path("names.txt")
lazy val names:List[String] = namesFile.lines().toList

def main(args: Array[String]): Unit = {
val result = Random.shuffle(names).head
Expand Down

0 comments on commit 173a1cf

Please sign in to comment.