Well, right now i'm following a tutorial on game making for c++, but is this really the best programming language for video games? Also i'd like to know if can recommend me a book ( i've seen some book on amazon but i don't really know wich one to choose ), or tutorial about this, cause since i'm just 15, there's no teacher ( yet ) to talk with about this kind of things ( Consider that i'm a really noob sooo... ) Well thanks and thats all

Member Avatar
Member Avatar
+0 forum 38

I have developed a player v/s player game for tic tac toe..but can't understand the logic for AI ..can someone please include the AI segment in my code because i so much need it for my school project #include<iostream.h> #include<conio.h> #include<string.h> char grid [3][3]; void display_grid() { for(int i=0;i<3;i++) { cout<<"\n\t_____________\n\t| "; for(int j=0;j<3;j++) cout<<grid[i][j]<<" | "; } cout<<"\n\t_____________\n\t"; } int checkwin() { int i,j,c=0;char ch; for(i=0;i<3;i++) { c=0; ch=grid[i][0]; for(j=1;j<3;j++) if(ch!=grid[i][j]){c=1;break;} if(c==0){if(ch=='X')return 1; else if(ch=='O') return 2;} } for(j=0;j<3;j++) { c=0; ch=grid[0][j]; for(i=1;i<3;i++) if(ch!=grid[i][j]){c=1;break;} if(c==0){if(ch=='X')return 1; else if(ch=='O')return 2;} } c=0; ch=grid[0][0]; for(i=1;i<3;i++) { if(grid[i][i]!=ch){c=1;break;} } if(c==0){if(ch=='X')return 1; else …

Member Avatar
Member Avatar
+1 forum 6

The End.