Skip to content

Instantly share code, notes, and snippets.

@AndrewReitz
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AndrewReitz/3d28e792215146c05844 to your computer and use it in GitHub Desktop.
Save AndrewReitz/3d28e792215146c05844 to your computer and use it in GitHub Desktop.
Random Dots
def randDots:String = {
val nLines = 100
val width = 80
Seq.range(0, nLines*width).map(a=>if(scala.util.Random.nextBoolean())"." else " ").grouped(width).map(_.mkString("")).mkString("\n")
}
while(true){
println(randDots)
Thread.sleep(scala.util.Random.nextInt(5000))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment