int main() { int A[200]; int B[200]; int C[200]; srand(time(NULL)); randomArr(A,B,C); printArr(A,B,C); }
//this method asks user for the configuration of the simulation, then calls the user mode method void gameOfLife::userConfig(){ //get user input incase they choose file input option cout<<"What configuration? Random or flat file?"<<endl; cin>>configuration; if(configuration == "random" || configuration == "Random") { cout<<"How many rows?"<<endl; //check for correct input... cin>>userRow; cout<<"How many columns?"<<endl;//check for correct input... cin>>userColumn; cout<<"How dense should it be?"<<endl; cin>>userDensity; cout<<"Here is your random game board: "<<endl; cout<<endl; randomArr(userRow, userColumn); printArray(); cout<<endl; userMode(); }
int main() { bool blockCpye[4][4]={false,};//임의의 배열을 저장할 배열. int ch=0;//키보드 입력 변수. int x=1,y=0; randomArr(*blockCpye);//선택된 배열을 temp변수에 복사. initialize(blockCpye,true); for(int i=0;i<4;i++) { for(int j=0;j<4;j++) { printf("%d",blockCpye[i][j]); } printf("\n"); } return 0; }