exercise2

exercise2 - #include <iostream> # #include...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
#include <iostream> #include <sstream> # using namespace std; u // Function to update to boardgame void updating_game(string c[]) { system("cls"); cout << "New Game ? type 10" << endl << endl; cout << c[0] << c[1] << c[2] << endl << c[3] << c[4] << c[5] << endl << c[6] << c[7] << c[8] << endl << endl; } // Function to change the payer turn. void change_turn(int *playerturn) { if(*playerturn == 1) *playerturn = 0; // if player's O turn => player X else *playerturn = 1; // if player's X turn => player O } // to verifie if one of the ywo players has won, return an int consequently int check_gameover(string c[]) { // all the possibilities of winning for player O if((c[0] == "O" && c[1] == "O" && c[2] == "O") || (c[3] == "O" && c[4] == "O" || (c[0] == "O" && c[3] == "O" && c[6] == "O") || (c[1] == "O" && c[4] == || (c[0] == "O" && c[4] == "O" && c[8] == "O") || (c[2] == "O" && c[4] ==
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/01/2009 for the course AV 244 taught by Professor Dub during the Spring '09 term at ECE.

Page1 / 2

exercise2 - #include &lt;iostream&gt; # #include...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online