home *** CD-ROM | disk | FTP | other *** search
- // -------- ttt.h
-
- #ifndef TTT_H
- #define TTT_H
-
- #include <theatrix.h>
- #include "piece.h"
- #include "voice.h"
-
- class TicTacToe : public SceneryDirector {
- enum soundclip {
- iwin = 1,
- youwin,
- tie,
- notthere,
- hmm,
- ohno,
- nowwhat
- };
- int play;
- int isover;
- Piece *piece;
- Voice *voice;
- static char board[9];
- static int wins [8][3];
- void display();
- void hide();
- void initialize_play();
- DECLARE_MOUSECURSORS
- void position(int pos);
- void position1() { position(1); }
- void position2() { position(2); }
- void position3() { position(3); }
- void position4() { position(4); }
- void position5() { position(5); }
- void position6() { position(6); }
- void position7() { position(7); }
- void position8() { position(8); }
- void position9() { position(9); }
- void nextmove();
- int canwin(int n);
- int trywin(int n,int *wn);
- int won();
- void say(soundclip);
- public:
- TicTacToe();
- ~TicTacToe();
- void update(int square = 0, int piece = 0);
- };
-
- const int player = 1;
- const int computer = 2;
-
- #endif
-
-