C++ Stuff

BlitzMax Forums/BlitzMax Programming/C++ Stuff

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Hello. I have looked in your tutorial but I am still stumpted. You have included <vector> but you don't even use any vectors in your code. What should I do now?

Here is the troublesome code, where uint is unsigned int:
 void placemines(uint mines)
	  {
		remaining = (x-2) * (y-2) - (minenum = mines);
		srand(time(0));
		vector<uint> placementx(x-2);
		vector<uint> placementy(y-2);
		forall(i, x-2)
		    placementx[i] = i+1;
		forall(i, y-2)
		    placementy[i] = i+1;
		random_shuffle(placementx.begin(), placementx.end());
		random_shuffle(placementy.begin(), placementy.end());
		forall(i, mines)
		    mine[placementx[i]][placementy[i]] = true;
	  }


Here are the errors I get from BM:

In member function `void
gametype::boardtype::placemines(unsigned int)':
`vector' undeclared (first use this
function)
(Each undeclared identifier is reported only
once for each function it appears in.)
parse error before `;' token
parse error before `;' token
`placementx' undeclared (first use this
function)
`placementy' undeclared (first use this
function)
`random_shuffle' undeclared (first use this
function)