How can I improve my TripleX game?

Hello, I wanted to add to my game an ascii code image using std::cout << “the ascii code”;, but it doesn’t work (it gives me an error), and I wanted to ask if someone knows how to put the ascii code.
Finally, I want my game to be in Spanish, but when I put characters (such as ñ, é, ó…), it doesn’t work.
Thank you for reading!

The ascii code you’re trying to print will most likely have escape characters in them for example \n is a newline, so if you wanted to actually print that instead of a newline then you would need to add an additional \ i.e. \\n.
Instead of adding \'s everywhere you can instead use raw string literals where you have this and everything within the () is treated as is.

R"()"

A new line would be \n
and \n is \\n i.e.

std::string Word = R"(Hello
my name \n is Dan.
)";

So that would mean Word is "Hello\nmy name \\n is Dan.\n"

As for the Spanish characters just put this at the beginning of main.

setlocale(LC_ALL, "Spanish");

Thank you a lot!

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms