Because if u want me to do a Text game i think i will need just : char,int,array,cin.cout,if,else,while,do while? not too much .I was thinking at making a maze but i am too stupid to make an object to move around (I CANT find any tutus on net)
I thought if i make something like this will work but i am pretty sure it wont work : so if we have a char ,,&,, and a room:
1 2 3 (<== room)
4 & 6
7 8 9
and he is siting on 5 i can make him to move using an algoritm like : 8-5 = 2 if he want to go to 2 but i cant imagin how to move an object around using MATH (i am not so bad at match but this is very hard) whitout that ideea from up i cant imagin something else...
I was thinking at this cuz when i made the tic-tac toe it was like this, but i want to make him to move perfect not in many screens if u understand.
And i was thinking to add:
(i cant make it to work on the forum but u can try it for yourself)
* * * * * * * * * * * *
* *
* Hello, Vlad! *
* *
********************
so i made this program:
// ask for a person's name, and generate a greeting
#include <iostream>
#include <string>
int main()
{
std::cout << "Please enter your first name: ";
std::string name;
std::cin >> name;
// build the message that we intend to write
const std::string greeting = "Hello, " + name + "!";
// build the second and fourth lines of the output
const std::string spaces(greeting.size(), ' ');
const std::string second = "* " + spaces + " *";
// build the first and fifth lines of the output
const std::string first(second.size(), '*');
// write it all
std::cout << std::endl;
std::cout << first << std::endl;
std::cout << second << std::endl;
std::cout << "* " << greeting << " *" << std::endl;
std::cout << second << std::endl;
std::cout << first << std::endl;
return 0;
}
(i dont know if this is a rule but when i want to use the string amd i use << xxx << instend of + xxx + is not working)
If someone know a better way to show the ,,*,, please post it,thanks for reading,please comment
and a way to put the ,*, as the walls(it dosent matter if they are solid -for text game dosent mater, but if u know how to make it solid leave anathor post .
Finally i want to thanks to everyone for such a good COMUNITY! Have a nice day !
Use code tags please (there's a button in the text editor shaped like "<>".
write
using namespace std;
at the top of your code (below #include <iostream>)
That way you don't have to write out 'std::' all the time