eyesrglazed
Programmer
Ok. I am transferring the method I use for a graphing calculator game I wrote over to C++. IMy only problem right now it getting the map to read...
Does anyone know why this doesn't work???
Also, if anyone is wondering, I am using 5.0. I don't think that would contribute to the problem, though.
Does anyone know why this doesn't work???
Code:
#include <iostream>
using namespace std;
int main()
{
int map[9][16] =
{
{ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{ 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 3, 1, 1},
{ 1, 3, 0, 0, 0, 0, 2, 2,-1, 0, 0, 2, 0, 2, 0, 1},
{ 1, 0, 0, 2, 0, 2, 0, 0,-1, 1, 0, 2, 0, 0, 1, 1},
{ 1, 1, 1, 1, 2, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1},
{ 1, 1,-1, 0, 2, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1},
{ 1, 3,-1,-1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1},
{ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{ 2, 8, 8,15, 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
};
//This is what it should print...
/*
cout << "[URL unfurl="true"]WWWWWWWWWWWWWWWW"[/URL] << endl;
cout << "[URL unfurl="true"]WWWWWWW[/URL] [URL unfurl="true"]WWWW:WW"[/URL] << endl;
cout << "W: //O / / W" << endl;
cout << "W / / OW / WW" << endl;
cout << "[URL unfurl="true"]WWWW/WW[/URL] [URL unfurl="true"]WWWWWWW"[/URL] << endl;
cout << "WWO / WW W" << endl;
cout << "W:OO/ W" << endl;
cout << "[URL unfurl="true"]WWWWWWWWWWWWWWWW"[/URL] << endl;
*/
//And this is what it prints...
/*
OW/:
OW/:
OW/:
OW/:
OW/:
OW/:
OW/:
OW/:
*/
int x = 0;
int y = 0;
while (x != 9)
{
if (map[x][y] =-1)
cout << "O";
if (map[x][y] = 1)
cout << "W";
if (map[x][y] = 2)
cout << "/";
if (map[x][y] = 3)
cout << ":";
y++;
if (y = 16)
{
cout << endl;
y = 0;
x++;
}
}
return 0;
}
Also, if anyone is wondering, I am using 5.0. I don't think that would contribute to the problem, though.