i am working on a ticktacktoe game for a while. I code it with 9 string first but i decided to re code it using 2 dimensional array.But i need to use it as string. I code a little for my new game but it is not working.
#include <iostream>
#include <string>
usingnamespace std;
int tur=1;
int boardfonk(int alan){
string board[ alan+1 ][ alan+1 ];
if(tur==1){
for( int i=1; i<=alan ; ++i){
for(int j; j<alan; ++j){
board[ i ][ j ] ="|.'i*j'.|";}}// i want there to give number to each box which is playable.But i think there is a problem
}
for(int i=1; i<=alan ; ++i){
for(int j=1; j<alan; ++j){
cout<<board[ i ][ j ]<<endl;}
}
}
int main(){
int alan;
string oyuncu1;
string oyuncu2;
cout<<"Alan buyuklugunu seciniz:";
cin>> alan; //the board is sizeable so it ask to use the size. alan*alan,3*3,4*4 etc..
cout<<"1.oyuncunun adini girin:";
cin>> oyuncu1;
cout<<"2.oyuncunun adini girin:";
cin>> oyuncu2;
boardfonk( alan );
system("pause");
}