Help with a x and 0 game.

closed account (23h0pfjN)
#include <iostream>
#include <string>
using namespace std;

void infolenta();
void lenta();
void info();
void lenta(string a, string b, string c, string d, string e, string f, string g, string h, string i);
void dejimas();

int main()
{
string pas;
string zenklas;
int Zpas;
cout << "Kryziukai, nuliukai! ver 0.1 (Dominykas Litvaitis)" << endl;
infolenta();
cin >> pas;
if(pas=="/info"){
info();
}
cout << string(50, '\n');
cout << "Koks jusu skaiciaus pasirinkimas?: ";
dejimas();


}
void infolenta(){
cout << "|-----------|" << endl;
cout << "| 1 | 2 | 3 |" << endl;
cout << "|-----------|" << endl;
cout << "| 4 | 5 | 6 |" << endl;
cout << "|-----------|" << endl;
cout << "| 7 | 8 | 9 |" << endl;
cout << "|-----------|" << endl;
cout << "\nInformacijai kaip zaisti rasykite: /info, tiesiok testi rasykite /testi." << endl;
}
void info(){
cout << "Kada jusu paprasote irasote skaiciu nuo 1 iki 9." << endl;
cout << "Pagal juos nustatys, kur desis zenklas." << endl;
cout << "Pirmoje lenteleje parodyta, kaip viskas issidestis." << endl;
cout << "Zenkliukas ~ reiskia nieko ten nera." << endl;
}
void lenta(string a, string b, string c, string d, string e, string f, string g, string h, string i){
cout << "|-----------|" << endl;
cout << "| " << a << " | " << b << " | " << c << " |" << endl;
cout << "|-----------|" << endl;
cout << "| " << d << " | " << e << " | " << f << " |" << endl;
cout << "|-----------|" << endl;
cout << "| " << g << " | " << h << " | " << i << " |" << endl;
cout << "|-----------|" << endl;
}
void dejimas(){
int Zpas;
while(1){
cin >> Zpas;
if(Zpas==1){
lenta("x","~","~","~","~","~","~","~","~");
}
if(Zpas==2){
lenta("~","x","~","~","~","~","~","~","~");
}
if(Zpas==3){
lenta("~","~","x","~","~","~","~","~","~");
}
if(Zpas==4){
lenta("~","~","~","x","~","~","~","~","~");
}
if(Zpas==5){
lenta("~","~","~","~","x","~","~","~","~");
}
if(Zpas==6){
lenta("~","~","~","~","~","x","~","~","~");
}
if(Zpas==7){
lenta("~","~","~","~","~","~","x","~","~");
}
if(Zpas==8){
lenta("~","~","~","~","~","~","~","x","~");
}
if(Zpas==9){
lenta("x","~","~","~","~","~","~","~","x");
}else{
cout << " Negalima rasyti sito!" << endl;
}
}

}
The word are in lithuanian soory, anyway how can i make that when i set the x to a place i wouldnt need to change the other ones? also dont make it too deep, leave me somthing to do :D
Use code tags please
switch statements are nice :)
closed account (23h0pfjN)
code tags? and how could i use switch statements?
Last edited on
Topic archived. No new replies allowed.