Jump to content
  • Advertisement
Sign in to follow this  
Deamonslayer

Simple map problem

This topic is 4950 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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!