some basic things
i just wanted to make a program that can move a '-' according to directional key input.. but i dont know how to take input of the direction keys...
eh, is there any alternative to getch () ?
key = getch ();
if (key == ????).....
and how do i change the current cursor position... i remeber using gotoxy(int , int) while i was doing C in borland 5.02 but it doesn't work now with codeblocks...
You need to use a library like ncurses.
i had expected it to be an easy job... isnt there any other way?
There are probably other ways, but I doubt any of them will be easier. You are looking for non-standard behavior. In other words, the C++ language does not provide the functionality you are looking for, so you need to use a third party library, or call OS specific functions (which is pretty much what the library would do for you).
If you're using Windows, look in the Win32 forum for the useful links post, one of the links is a great tutorial which goes into setting cursor positions, reading keyboard input, changing colors etc. I'd post the link but I'm on my freaking Blackberry.
If you're using Windows, and you're using Microsoft's compiler or gcc (e.g. Dev-C++ or Code::Blocks), you can do it (albeit unportably). Cprogramming.com FAQ > How can I get input without having the user hit [Enter]?
With Dev-C++, for example, you can use getche() (which unfortunately echos the character too), or Windows code to emulate getch().
Then you have to figure out what the key sequences are for the arrow keys.
You might be interested in this simple text editor I wrote a long time ago. The PLATFORM_WINDOWS code is the code you need for Dev-C++.
 I stripped the source code because it's pretty long. See attached file instead. [/edit]
[edit=2] P.S. Traditionally the player is represented with a '@', if it's a rogue-like. ;) [/edit]
Here's the first page I found with a google search of "getch arrow keys"
How do you check if arrow keys are pressed? - C
huh... after a short 2 days vacation i finally figured it out.. i will use getch() to input keys (for now wsad, will go for arrow keys shortly) and create a function gotoxy using windows.h faq lvl 2 : how to ...