int main(){ struct gameState gs; int player; int trashFlag; int returned=0; int numPlayers = 2; int handCount=5; int randomSeed = rand() % 100 + 1; int test1[5] = { copper, copper, copper, copper, copper }; int test2[5] = { copper, silver, estate, duchy, silver }; int kingdom[10]= { adventurer, baron, council_room, feast, gardens, great_hall, mine, remodel, smithy, tribute }; memset(&gs, 23, sizeof(struct gameState)); initializeGame(numPlayers, kingdom, randomSeed, &gs); memcpy(gs.hand[0], test2, sizeof(int)*handCount); memcpy(gs.hand[1], test1, sizeof(int)*handCount); gs.handCount[0]=5; gs.handCount[1]=5; printf("\nTesting player 0 (Trash Flag set)\n"); player=0; trashFlag=1; returned += testDiscardCard(&gs, player, trashFlag); printf("\nTesting player 1 (Trash Flag not set)\n"); player=1; trashFlag=0; returned += testDiscardCard(&gs, player, trashFlag); if(returned == 0) printf("\nAll discardCard tests passed!\n"); else printf("\n%d discardCard tests failed.\n", returned); return 0; }
int main(){ testDiscardCard(); printf("\n\n"); printf("=======================Sucess====================="); printf("\n\n"); return 0; }
int main(int argc, char *argv[]) { int numPlayers = 2; int handPos = 3; int currentPlayer = 0; int kingdomCards[10] = {adventurer, gardens, embargo, village, minion, mine, cutpurse, sea_hag, tribute, smithy}; int randomSeed = 100; int trashFlag; struct gameState *state; // New game // state = newGame(); initializeGame(numPlayers, kingdomCards, randomSeed, state); printf("\n"); // Discard a trashed card printf(">>> TESTING: discardCard(), trashed card...\n"); trashFlag = 1; // trashed testDiscardCard(handPos, currentPlayer, state, trashFlag); //printf("\n"); // New game // state = newGame(); initializeGame(numPlayers, kingdomCards, randomSeed, state); // Discard a non-trashed card printf(">>> TESTING: discardCard(), non-trashed card...\n"); trashFlag = 0; // not trashed testDiscardCard(handPos, currentPlayer, state, trashFlag); return 0; }
int main(){ int i, k; printf("Intializing.\n"); int players = 2; int seed = 433; struct gameState *state = newGame(); int card[10] = {adventurer, embargo, village, minion, mine, cutpurse, sea_hag, tribute, smithy, council_room}; initializeGame(players, card, seed, state); for(i=0; i<players; i++){ for(k=0; k<2; k++){ testDiscardCard(1, i, state, k); } } return 0; }
int main(){ testDiscardCard(); return 0; }