All pastes #734662 Raw Edit

Zeug

public text v1 · immutable
·published 2007-10-12 22:10 UTC
rendered paste body
#ifndef FOURWINS_H
#define FOURWINS_H

#ifdef _WIN32
#define CLEARSCREEN system("cls");
#endif

/* Board Options */
const char boardRow = '|';
const char boardCol = '|';
const char boardEmptyField = '_';

/* Game Options */
const int maxRows  = 7;
const int maxCols  = 6;
const int maxCoins = 42;

enum eFWRet
{
	EFW_OK = 0,
	EFW_QUIT,
	EFW_RESTART,
	EFW_FULL,
	EFW_END,
	EFW_NO_COINS,
};

enum eFWPlayer
{
	EFW_PLAYER_ONE = 1,
	EFW_PLAYER_TWO
};

class FourWins
{
	private: 
		int **m_Field;	// 6 Rows, 7 Columns
		int m_coinsLeft;	// 7*6 = 42/2 = 21 per Player
		int m_curPlayer;	// who's playing

	public:
		FourWins( void );
		~FourWins( void );

		int** getBoard( void );
		int	  getCurPlayer( void );

		void  nextPlayer( void );
		int   setCord( int x );

		void  restart( void );

	protected:
		void initBoard( void );
		int  check( void );
};

void printFourWinsBoard( int** board );
void printFourWinsHelp( void );
int doFourWinsRound( FourWins* game );

#endif /* FOURWINS_H */