0

I have one algorithm to find a way out from the labyrinth. I want to display it in console, and for every step update my position there. So I don't want to repeat the same string in console, I want to update it.

Lets say I have some string like that

.W.
.W.
...

Where 'W' is a wall. And I want to set some marker to track my algorithm execution. Lets say it will be a star symbol '*'. Then I want to update star position in console.

*W.
.W.
...

--->

.W.
*W.
...

and so on.

Alex Lance
  • 371
  • 1
  • 2
  • 10
  • 3
    Does this answer your question? [Node.js console.log - Is it possible to update a line rather than create a new line?](https://stackoverflow.com/questions/17309749/node-js-console-log-is-it-possible-to-update-a-line-rather-than-create-a-new-l). That's specifically for NodeJS though, it wouldn't work in e.g. the browser. – Kelvin Schoofs Aug 01 '21 at 13:54
  • 1
    https://github.com/chjj/blessed looks like it will support what you want. – erik258 Aug 01 '21 at 13:56

0 Answers0