Skip to content

Instantly share code, notes, and snippets.

@danielkroeni
Created August 10, 2012 06:34
Show Gist options
  • Select an option

  • Save danielkroeni/3311827 to your computer and use it in GitHub Desktop.

Select an option

Save danielkroeni/3311827 to your computer and use it in GitHub Desktop.

Revisions

  1. danielkroeni revised this gist Aug 10, 2012. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions gistfile1.scala
    Original file line number Diff line number Diff line change
    @@ -1,2 +1 @@
    def s: Stream[String]= Stream("|","/","-","\\").map("\b" + _).append(s)
    s foreach {c => print(c); Thread.sleep(100)}
    Stream.continually(Seq("|","/","-","\\").map("\b" + _).toStream).flatten.foreach { c => print(c); Thread.sleep(100)}
  2. danielkroeni revised this gist Aug 10, 2012. 1 changed file with 2 additions and 3 deletions.
    5 changes: 2 additions & 3 deletions gistfile1.scala
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,2 @@
    def s: Stream[String]= "|" #:: "/" #:: "-" #:: "\\" #:: s
    def sb = Stream.continually("\b") zip s map (x => x._1 + x._2)
    sb foreach {c => print(c); Thread.sleep(100)}
    def s: Stream[String]= Stream("|","/","-","\\").map("\b" + _).append(s)
    s foreach {c => print(c); Thread.sleep(100)}
  3. danielkroeni created this gist Aug 10, 2012.
    3 changes: 3 additions & 0 deletions gistfile1.scala
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    def s: Stream[String]= "|" #:: "/" #:: "-" #:: "\\" #:: s
    def sb = Stream.continually("\b") zip s map (x => x._1 + x._2)
    sb foreach {c => print(c); Thread.sleep(100)}