basically I want to do the following:
let's say I have two methods:
def printA(i: Int){
print("Value A: " + i)
}
def printB(j: Int){
print("Value B: " + j)
}
Now - for example - I use this both methods do print out some results for a computation. I want that both values can be updated without printing a new line each time (when using println()) or concatenating the new values the the older ones (when using print()).
The output behind ":" should be updated for both lines idependently.
In Python I would use placeholders:
def printA(i):
print '\rValue A: %d' % (i),
sys.stdout.flush()
The comma prevents Python to insert "\n". For Scala it should quite work the same way with carriage return ("\r").
The Problem is, that I now want to update to prints idependently but carriage return destroys the whole output and so only the last line is printed.
Is there any solution to do this in scala?
Thanks for your help!
Regards