Пример #1
0
int main() {
	introMenu();
	Stage stg[2];

	// loop in size of stage
	for (int i = 0; i < 2; i++) {
		stg[i].setCar();
		inputMouse a(stg[i].getCar());
		while (1) {
			if ( a.read()==1 )
				colorScreen(&stg[i]);

			if (stg[i]._map[3][7] != 0) {
				printf("GAME OVER");
				break;
			}
		}
	}

}
Пример #2
0
int main ( ) {
	
	int introChoice, gameMenuChoice, rows, columns, restartBoard, enterNewBoard;
	int i;
	char initBoard [HEIGHT] [WIDTH];
	char currentBoard [HEIGHT] [WIDTH];
	char nextGenBoard [HEIGHT] [WIDTH];
	char pattern [HEIGHT] [WIDTH];
	char repeat;
	
	
	do{
		enterNewBoard = 0;
		rows = 0;
		columns = 0;
		
	do{


	cout << endl << "*** Spaces Between Spaces ***" << endl;
	introMenu(introChoice);
	
	if (introChoice == 1) {
		enterFromKeyboard ( initBoard, rows, columns);
		repeat = 'n';
	}
	
		else if (introChoice == 2) {
			cout << endl<< "Load From Files" << endl;
			boardDataFile(initBoard, rows, columns);
			repeat = 'n';
		}
	
			else if (introChoice == 3) {
				cout << "Load Presets" << endl;
				loadPattern(initBoard, pattern, rows, columns);
				repeat = 'n';
				}
	
	else {
		cout << "Error: Invalid Entry" << endl << endl;
		repeat = 'y';
	}
	
}while (repeat == 'y');
	
	arrayCopy(currentBoard, initBoard);
		
	displayCurrentBoard ( currentBoard, rows, columns);
	
do{
	restartBoard = 0;
	gameMenuDisplay(gameMenuChoice);

	if (gameMenuChoice == 1) {
		playGame(currentBoard, nextGenBoard, rows, columns);
		restartBoard = 1;
	}
	
		else if (gameMenuChoice == 2) {
			restart(initBoard, currentBoard);
			restartBoard = 1;
		}
	
			else if (gameMenuChoice == 3) {
				cout << "Displaying Current Board...." << endl;
				displayCurrentBoard(currentBoard, rows, columns);
				restartBoard = 1;
			}
			else if (gameMenuChoice == 4){
				cout << "Enter a New Board" << endl;
				restartBoard = 0;
				enterNewBoard = 1;
				for (i = 0; i < 7;++i) {
					cout << endl;
				}
			}
			else if (gameMenuChoice == 5){
				cout << endl << endl << endl;
				restartBoard = 0;
			}
} while ( restartBoard == 1);
	}while (enterNewBoard == 1); // loop that allows User to enter new board
	
	cout << "Have A Good Day" << endl;
		cout << "Goodbye!" << endl << endl;
		return 0;
}											// End of int main