Jun 9, 2013 at 8:26am UTC
Is gotoxy command only available in Windows Platform? in that case, what is the best way to move a character around the screen?
Last edited on Jun 9, 2013 at 8:32am UTC
Jun 9, 2013 at 9:00am UTC
Using cross-platform console handler (and, on Windows, console emulator)
Like ncurses on Linux, PDCurses on Windows.
Jun 9, 2013 at 9:39am UTC
A question for Linux folk.
According to wikipedia.org
Most terminal emulators running on Unix-like systems (such as xterm and the OS X Terminal) interpret ANSI escape sequences.
(from ANSI escape code
http://en.wikipedia.org/wiki/ANSI_escape_code )
So would it be possible to implement gotoxy using the HVP (Horizontal and Vertical Position) escape code? e.g. to move to position (5, 8) you'd use the control sequence \033[5;8f
So far I've only see this approach used for text color, e.g.
Hex viewer
http://www.cplusplus.com/articles/NwTbqMoL/
(which uses the SGR (Select Graphic Rendition) escape code to color the output.)
But it should work for positioning as well, yes?
Andy
Last edited on Jun 9, 2013 at 9:41am UTC