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
  • 2,826
  • 4
  • 31
  • 53

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,205
  • 16
  • 36