There is a easier way and more efficent way to do this with a for loop I believe...I can't put the nail on it can anyone help me out?
I want to move a character around in a array...right or left or up and down with md arrays.
#include <cstdlib>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
int map[3] = { 1,0,0,};
for (int i=0;i<3;i++)
{
cout << map[i] << " ";
}
char move;
cout << "[[R]ight\t";
cin >> move;
switch ( move )
{
case 'R':
int map[3] = { 0,1,0,};
for (int i=0;i<3;i++)
{
cout << map[i] << " ";
}
}
cin.get();
return EXIT_SUCCESS;
}