03-11-2011, 07:11 PM
(This post was last modified: 03-11-2011, 07:11 PM by InfamousKnight.)
This is quite an old projects.
Code:
#include <iostream>
using namespace std;
char map[10][11] = {{'+','-','-','-','-','-','-','-','+'},
{'|',' ',' ',' ',' ',' ',' ',' ','|'},
{'|',' ',' ',' ',' ',' ',' ',' ','|'},
{'|',' ',' ',' ',' ',' ',' ',' ','|'},
{'|',' ',' ',' ',' ',' ',' ',' ','|'},
{'|',' ',' ',' ',' ',' ',' ',' ','|'},
{'|',' ',' ',' ',' ',' ',' ',' ','|'},
{'|',' ',' ',' ',' ',' ',' ',' ','|'},
{'|',' ',' ',' ',' ',' ',' ',' ','|'},
{'+','-','-','-','-','-','-','-','+'}};
int main()
{
char kbinput;
int x1 = 0, y1 = 0;
while (true) {
cout << endl << endl << endl << endl << endl << endl << endl << endl << endl << endl << endl;
int x, y;
for(x = 0; x <= 10; x++) {
for (y = 0; y <= 10; y++)
cout << map[x][y];
cout << endl;
}
cout << "Input coordinates for x..." << endl;
cin >> x1;
cout << "Input coordinates for y..." << endl;
cin >> y1;
cout << x1 << " " << y1 << endl;
cout << "Input Character" << endl;
cin >> kbinput;
map[x1][y1] = kbinput; // changed x to x1 and y to y1
}
}