//header //HEADER FILE FOR ASCIILAND #ifndef ASCIILAND_H #define ASCIILAND_H #include #include #include #include //-------------------------------------------------------- class asciiland { public: asciiland(); //constructor void position (int roll, int &pos); //gets roll calculates and returns position through perameters void check (int &posA, int &posB); //checks if player lands on other players position void display (int posA, int posB); //displays to the screen the position of the players private: RandGen R; void getroll( int&); }; //note semicolon //-----------------PUBLIC------------------------------------------ asciiland::asciiland() { } //========================================================= void asciiland::position(int roll, int &pos) //DETERMINE PLAYERS POSITION { switch (roll) { case 1: pos+=1; break; case 2: pos+-2; break; case 3: pos+=3; break; case 4: pos-=4; break; case 5: pos+=5; break; case 6: pos+=6; break; case 7: pos+=7; break; case 8: pos+=8; break; } if (pos<0) pos=0; } //============================================================== void asciiland::check( int & pos1, int & pos2) //CHECK IF PLAYER LANDS ON OTHER PLAYERS POS { if (pos1==pos2){cout<<"you landed on other persons position hAHa you get moved to start"; cin.get(); pos1=0;} } void asciiland::display(int posA, int posB) { clrscr(); cout<<"~-~~-~~-~~-~~-~!!**ASCII_LAND**!!~-~~-~~-~~-~~-~"< #include #include #include void main() { int rollA=0; int rollB=0; int posA=0; int posB=0; asciiland asciiland1(); while (posA<41 && posB<41) { //====PLAYER A ROLE====== cout<<"player A's turn...hit enter to roll"; cin.get(); asciiland1.getroll(rollA); cout<<"your roll was"<0) asciiland1.check(posA, posB); asciiland1.display(posA,posB); //=====PLAYER B ROLL===== cout<<"player B's turn...hit enter to roll"; cin.get(); asciiland1.getroll(rollB); cout<<"your roll was"<0) asciiland1.check(posB, posA); asciiland1.display(posA,posB); } }