Sign in to follow this  

Simple map problem

This topic is 4733 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

alright im working in MC++ Console App, and im trying to make a small Text RPG, more like a dungeon levels were u kill things and such, i mapped it all out like it should be done. but i am having problems with making my map. i am using the For Loop for(y=0;y<=MapY;y++) for(x=0;x<=MapX;x++) { cout << Wall; } instead of getting my 25 of WWWWW <- What i want outputted, wwwww i get a long strip of wwwwwwwwwww wwwww it's probably something really dumb that i looked over, but help is wwwww always welcome. wwwww

Share this post


Link to post
Share on other sites
what is the value of 'Wall', what data type is it? If its a character then change it to an uppercase 'W'. I believe there is a flag to do this with iostream (set all output to upper case) but dont recall, sorry.

EDIT: to set all output to uppercase use cout.setf(ios_base::uppercase);

EDIT2: bah yeah add a new line (like the post below :p), its late (2AM) got some coding to do and wasn't thinking ;)

HTH


[Edited by - nts on December 31, 2004 2:24:18 AM]

Share this post


Link to post
Share on other sites
I think you forgot to insert a newline while doing your loop. Should look like this:

for(y=0;y<=MapY;y++)
{
for(x=0;x<=MapX;x++)
{
cout << Wall;
}
cout << endl; //go "one row deeper"
}

Share this post


Link to post
Share on other sites

This topic is 4733 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this