1

I'm trying to put a simple console spinner into my scala application, but I'm not sure how to set the cursor position?

If it's not possible, is there another way of achieving this?

Andy
  • 3,228
  • 8
  • 40
  • 65

1 Answers1

1
val chars = List("/", "-", "\\", "|")
(0 to 30).foreach { _ => chars.foreach { cc =>
        print(s"\u0008$cc")
        Thread.sleep(150)
    }
}

Idea taken from that answer: Write to same location in a console window with java

vvg
  • 6,325
  • 19
  • 36