Ask your own question, for FREE!
Computer Science 7 Online
OpenStudy (anonymous):

In C++, I have a board where a character is. I need to ask the user whether they want to move it up, down, left right. They are allowed to enter 3 move per turn. like up, up, left. How do I do this?

OpenStudy (rsmith6559):

You could set up a loop that will allow 3 (validated) entries, and break out of it if a sentinel value is entered.

OpenStudy (hunus):

You could make a matrix by making an array with multiple arrays inside of it and where each element of the matrix is a position

OpenStudy (hunus):

like int position[5]; int row = [0, 0, 0, 0, 0] for(i=0; i<5; ++i){ position[i] = row; } which would make the position array contain {[0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]}

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!