easy qustion in c++

Hello guys, i would like to ask you about c++ language. i have an assignment and i want to do a movement for the hero?
i have an assignment and i want to do a movement for the hero which will be controled by the keyboard,please help me and i apologise because my english isn't very well waiting for you . the map is similar to this:

|------|------|------|
| h
|------|------|------|

h = the hero, d= move right , a= move left ,if the user enter 'd' so i want the hero to move to next room and when the user press 'd' again so the hero should move to the last room , i tried many times just know but i couldn't do it

i tried to do this soultotion

1- i use a lot of functions to do the movement for the hero but my problem is i put every room for each of functions
for example if the user key 'a' so the hero will be in the left room, but if he key 'd' to go back to the middle , the hero will move to the right room because i put the function called 'hero_right' and the position of the hero is alaways right
thats why i put another key (control by keboards) called 'm' for the middle position
a = left room
d = right room
m = middle room

please help
Last edited on
I'm sorry, I don't understand your question.
Are you asking, how to print text on the screen?
or are you asking how to get user input?
or maybe how to combine these two into a game?
I hope you don't plan on implementing actual graphics, because if you don't know the answers to these questions there's no way you're going to be working with a graphics library any time soon.
sorry, you cant do that if you still not familiar with c++ ; learning c++ takes time

if you are in a hurry, i guess you should be able to do that with visual basic..
learning c++ takes time

qft
sorry guys i copied my qustions wrongly
post some code please.
Topic archived. No new replies allowed.