me falta literalmente lo mas importante.. pero necesito un empujon para seguir;
Código
#include<iostream> #include<fstream.h> #include<time.h> #include <stdlib.h> #include <windows.h> using namespace std; int XOBoard[3][3]; /*global variable board */ class Player /*Class of Players*/ { public: Player() { //CODE } void Draw() /*Function of Player class to draw the game board */ { cout<<"\n\n\n\n\n"; cout<<"\t\t\t Top "; cout<<"\n\t\t\t***************************\n"; cout<<"\t\t\t* . 1 2 3 *\n\t\t\t*.........................*\n"; if ( XOBoard[0][0] == 0 ) /*If else condition to draw the game board */ { cout<<"\t\t\t* 1. |"; } else if ( XOBoard[0][0] == 1) { cout<<"\t\t\t* 1. X |"; } else if ( XOBoard[0][0] == -1) { cout<<"\t\t\t* 1. O |"; } if ( XOBoard[1][0] == 0) { cout<<" |"; } else if ( XOBoard[1][0] == 1) { cout<<" X |"; } else if ( XOBoard[1][0] == -1) { cout<<" O |"; } if ( XOBoard[2][0] == 0) { cout<<" *"; } else if ( XOBoard[2][0] == 1) { cout<<" X *"; } else if ( XOBoard[2][0] == -1) { cout<<" O *"; } cout<<"\n\t\t\t* .----------------------*\n"; if ( XOBoard[0][1] == 0) { cout<<"\t\t Side * 2. |"; } else if ( XOBoard[0][1] == 1) { cout<<"\t\t Side * 2. X |"; } else if ( XOBoard[0][1] == -1) { cout<<"\t\t Side * 2. O |"; } if ( XOBoard[1][1] == 0) { cout<<" |"; } else if ( XOBoard[1][1] == 1) { cout<<" X |"; } else if ( XOBoard[1][1] == -1) { cout<<" O |"; } if ( XOBoard[2][1] == 0) { cout<<" *"; } else if ( XOBoard[2][1] == 1) { cout<<" X *"; } else if ( XOBoard[2][1] == -1) { cout<<" O *"; } cout<<"\n\t\t\t* .----------------------*\n"; if ( XOBoard[0][2] == 0) { cout<<"\t\t\t* 3. |"; } else if ( XOBoard[0][2] == 1) { cout<<"\t\t\t* 3. X |"; } else if ( XOBoard[0][2] == -1) { cout<<"\t\t\t* 3. O |"; } if ( XOBoard[1][2] == 0) { cout<<" |"; } else if ( XOBoard[1][2] == 1) { cout<<" X |"; } else if ( XOBoard[1][2] == -1) { cout<<" O |"; } if ( XOBoard[2][2] == 0) { cout<<" *"; } else if ( XOBoard[2][2] == 1) { cout<<" X *"; } else if ( XOBoard[2][2] == -1) { cout<<" O *"; } cout<<"\n\t\t\t***************************\n"; } int Human_win() /*function of class Player to output when user has won*/ { //code return 0; } int Computer_win() /*function of class Player to output when computer has won*/ { //code return 0; } int chkwinner() { return 0; } void Reset_board () { } void fill_XOBoard(int column, int row, int move_by) { } bool used_cell_check_for_Human(int column, int row) /*function of class Player to check whether the cell inout by Player has been occupied earlier or not*/ { return true; } bool used_cell_check_for_Computer(int column, int row) /*function of class Player to check whether the cell inout by Player has been occupied earlier or not*/ { return true; } int Chk_tie() { return 0; } int chk_cols() { return 0; } int chk_rows() { return 0; } int chk_diags() { return 0; } }; /*end class Player*/ class Human_Player : public Player { }; /*end class human*/ class Computer_Player: public Player /*inherited class computer from Player class*/ { }; /*end class computer*/ int main() /*main function begins*/ { Player Play; /*object of class Player*/ Human_Player h; /*object of class human*/ Computer_Player c; int trn=1; /*variable to denote turn of Player*/ int i=1; char ch='y'; /*character to input if Player wants to play again or not*/ int winner=1; /*integer to denote winner*/ int ctrl1,ctrl2; /*integer to denote winner*/ int ctr=0; int check_for_tie; char begin, Instruct; cout<<"\n\n\n\n\n"; cout<<"\n** ** ******** *******"; cout<<"\n** ** ******** ********"; cout<<"\n** ** ** ** ** **"; cout<<"\n** * ** ******** *******"; cout<<"\n** *** ** ******** *******"; cout<<"\n*** *** ** ** ** **"; cout<<"\n** ** ** ** ** **"; cout<<"\n\n\n"; for(ctrl1 = 0; ctrl1 < 2000; ctrl1++) { for(ctrl2 = 0; ctrl2 < 20000; ctrl2++) { } } cout<<"\n\t\t******** ********"; cout<<"\n\t\t******** ********"; cout<<"\n\t\t** ** **"; cout<<"\n\t\t** ** *****"; cout<<"\n\t\t** ** *****"; cout<<"\n\t\t******** **"; cout<<"\n\t\t******** **"; cout<<"\n\n\n"; for(ctrl1 = 0; ctrl1 < 2000; ctrl1++) { for(ctrl2 = 0; ctrl2 < 20000; ctrl2++) { } } cout<<"\n\t\t\t******** ** ** ********"; cout<<"\n\t\t\t******** ** ** ********"; cout<<"\n\t\t\t ** ******** **"; cout<<"\n\t\t\t ** ******** *****"; cout<<"\n\t\t\t ** ** ** **"; cout<<"\n\t\t\t ** ** ** ********"; cout<<"\n\t\t\t ** ** ** ********"; cout<<"\n\n\n"; for(ctrl1 = 0; ctrl1 < 2000; ctrl1++) { for(ctrl2 = 0; ctrl2 < 20000; ctrl2++) { } } cout<<"\n\t\t\t ** ******** ** ** ******* *******"; cout<<"\n\t\t\t ** ******** *** ** ******** ********"; cout<<"\n\t\t\t ** ** ** **** ** ** ** **"; cout<<"\n\t\t\t ** ******** ** ** ** ** ** **"; cout<<"\n\t\t\t ** ******** ** **** ** ** **"; cout<<"\n\t\t\t ******** ** ** ** *** ******** ********"; cout<<"\n\t\t\t ******** ** ** ** ** ******* *******"; cout<<"\n\n\n\n\n\t\t Welcome to the game WAR OF THE LANDS.\n\n\t\t"; cout<<"\nHello , I need to tell you the story of War of the Lands. "; cout<<"\nDo you want to read the instructions or simply proceede with the game ? \n(R)ead or (P)roceede :"; cin>>Instruct; if (Instruct=='R' ||Instruct=='r') { cout<<"\n\n A disputed area of 900 square meters lies between two neighboring villages. "; cout<<"\n The dispute between the neighboring villages has been running for "; cout<<"\n generations. The government has finally taken a decision to resolve "; cout<<"\n the dispute and grant the possession of this land to one of the "; cout<<"\n villages using a fair method. "; cout<<"\n\n\n The government has divided the disputed land into 9 equal square plots each"; cout<<"\n of 300 square meters as shown in the following figure:"; for(ctrl1 = 0; ctrl1 < 2000; ctrl1++) { for(ctrl2 = 0; ctrl2 < 20000; ctrl2++) { } } Play.Draw(); for(ctrl1 = 0; ctrl1 < 2000; ctrl1++) { for(ctrl2 = 0; ctrl2 < 20000; ctrl2++) { } } cout<<"\n\n The following method will be used to grant possession of the land to \n one of the villages: "; for(ctrl1 = 0; ctrl1 < 2000; ctrl1++) { for(ctrl2 = 0; ctrl2 < 80000; ctrl2++) { } } cout<<"\n\n The government has decided that the entire land will be given to the \n village that makes three successful plantations."; for(ctrl1 = 0; ctrl1 < 2000; ctrl1++) { for(ctrl2 = 0; ctrl2 < 80000; ctrl2++) { } } cout<<"\n\n At one point of time, only one village will plant vegetation on a \n square plot. Each village will be given a fair chance to grow \n vegetation in a square block, turn-by-turn."; for(ctrl1 = 0; ctrl1 < 2000; ctrl1++) { for(ctrl2 = 0; ctrl2 < 80000; ctrl2++) { } } cout<<"\n\n The first village that will plant vegetation on three square plots\n from one corner to the opposite corner (vertically, horizontally,\n or diagonally) will be given possession. For example,\n on plots (1,1), (2,2) and (3,3) or (2,1), (2,2), and (2, 3) and so on"; for(ctrl1 = 0; ctrl1 < 2000; ctrl1++) { for(ctrl2 = 0; ctrl2 < 80000; ctrl2++) { } } cout<<"\n\n Each village can plant in a way to block the other village from planting\n vegetation in three consecutive plots of land."; for(ctrl1 = 0; ctrl1 < 2000; ctrl1++) { for(ctrl2 = 0; ctrl2 < 80000; ctrl2++) { } } cout<<"\n\n In case all the plots have been planted and neither village has planted\n threeconsecutive plots of land, the government holds\n possession of the entire land. Both villages will be then\n given another chance to restart the plantation all over again."; for(ctrl1 = 0; ctrl1 < 2000; ctrl1++) { for(ctrl2 = 0; ctrl2 < 80000; ctrl2++) { } } cout<<"\n\n In the current scenario, one village is represented by I, the computer\n and the other village is by you, that is .\n The decision that who makes the first move lies with the you.\n Your plantation will be represented by 'X' on the plot of land\n and the computer's by 'O'."; cout<<"\n\n Each player will choose a plot of land by selecting the top and left\n coordinate pointing to the specific plot of land."; cout<<"\n\n\n\n\n Go ahead...Press ENTER when you are ready to face the challenge!!!"; cin.get(); } while(ch=='y' || ch=='Y') /*while loop to continue playing until user quits*/ { cout<<"\n\n So, do you want to make the first move or \n Should I make the first move?\n Enter (C) if you want me to begin , else press (I): "; cin>>begin; if (begin=='I'||begin=='i') trn=1; else if (begin=='c'||begin=='C') trn=-1; do /*do wbile loop to continue until there is a winner*/ { Play.Draw(); /*call function of class Player to draw the XOBoard*/ }while (winner!=1); ch='n'; } cout<<"\n\n\n\n\n\n\n\n\n\t\tBye bye !!!. See you soon..."; cin.get(); system("pause"); return 0; }
Alguna idea?
para completar el codigo?