本文整理汇总了C++中cardEffect函数的典型用法代码示例。如果您正苦于以下问题:C++ cardEffect函数的具体用法?C++ cardEffect怎么用?C++ cardEffect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cardEffect函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, int argv[])
{
struct gameState G;
struct gameState *p=&G;
int k[10] = {adventurer, gardens, embargo, village, minion, mine, cutpurse,
sea_hag, tribute, smithy};
printf ("Testing council_room card.\n");
int r = initializeGame(2, k, 5, p);
massert (r == 0,"initializeGame failed\n");
int player = whoseTurn(p);
int handPos = 0;
int coin_bonus=0;
G.handCount[player]=4;
G.hand[player][0]=council_room;
G.hand[player][1]=village;
G.hand[player][2]=minion;
G.hand[player][3]=mine;
G.numBuys=0;
int card = handCard(handPos,p);
massert(card>=adventurer&&card<=treasure_map,"invalid card\n");
massert(card==council_room,"incorrect card\n");
int test=cardEffect(card,-1,-1,-1,p,handPos,&coin_bonus);
massert(test==0,"cardEffect failed\n");
massert(G.handCount[player]==7,"incorrect had count\n");
massert(G.numBuys==1,"numBuys incorrect value\n");
massert(G.hand[player][0]!=council_room,"council_room is not discarded\n");
if(passed==0)
printf("---Test Passed!\n");
return 0;
}
开发者ID:CS362-Winter-2016,项目名称:cs362w16_devitaz,代码行数:40,代码来源:cardtest1.c
示例2: playCard
int playCard(int handPos, int choice1, int choice2, int choice3, struct gameState *state)
{
int card;
int coin_bonus = 0; //tracks coins gain from actions
//check if it is the right phase
if (state->phase != 0)
{
return -1;
}
//check if player has enough actions
if ( state->numActions < 1 )
{
return -1;
}
//get card played
card = handCard(handPos, state);
//check if selected card is an action
if ( card < adventurer || card > treasure_map )
{
return -1;
}
//play card
if ( cardEffect(card, choice1, choice2, choice3, state, handPos, &coin_bonus) < 0 )
{
return -1;
}
//reduce number of actions
state->numActions--;
//update coins (Treasure cards may be added with card draws)
updateCoins(state->whoseTurn, state, coin_bonus);
return 0;
}
开发者ID:cs362sp16,项目名称:cs362sp16_broderij,代码行数:40,代码来源:mutant100766_dominion.c
示例3: main
int main () {
struct gameState G;
int r;
int k[10] = {adventurer, gardens, embargo, village, minion, mine, cutpurse,
sea_hag, tribute, smithy};
printf("cardtest1:\n");
r = initializeGame(2, k, 10, &G);
assert (r == 0);
//Set up 1 cards to be drawn by great_hall
G.deck[0][0] = 100;
G.deckCount[0] = 1;
//Set up card to discard
G.hand[0][0] = 50;
G.handCount[0] = 1;
r = cardEffect(great_hall, -1, -1, -1, &G, 0, NULL);
if(r == -1) {
printf("\tFAILURE: cardEffect\n");
return 1;
} else {
printf("\tPASS: cardEffect\n");
}
if(G.handCount[0] != 1) {
printf("\tFAILURE: handCount\n");
return 1;
} else {
printf("\tPASS: handCount\n");
}
if(G.hand[0][0] != 100){
printf("\tFAILURE: hand\n");
return 1;
} else {
printf("\tPASS: hand\n");
}
printf("SUCCESS.\n\n");
return 0;
}
开发者ID:CS362-Winter-2016,项目名称:cs362w16_hamc,代码行数:39,代码来源:cardtest1.c
示例4: main
int main(int argc, char** argv)
{
struct gameState gameInstance;
int actions;
int t;
int k[10] = {adventurer, gardens, embargo, village, minion, mine, cutpurse,
sea_hag, steward, smithy};
printf("Test: Village\n");
initializeGame(2, k, 5, &gameInstance);
actions = gameInstance.numActions;
t = cardEffect(village, 0, 0, 0, &gameInstance, 0, NULL);
myAssert(gameInstance.numActions == actions + 2);
myAssert(t == 0);
printf("\n\n\n\n");
return 0;
}
开发者ID:CS362-Winter-2016,项目名称:cs362w16_harit,代码行数:22,代码来源:cardTest3.c
示例5: main
int main(){
int i;
int j;
int handPos;
int randomCard;
int handCount;
int ret = 0;
struct gameState *state = malloc(sizeof(struct gameState));
time_t t;
printf("Unit test 8 outpost card in dominion.c \n");
srand((unsigned)time(&t));
for(i = 0; i < MAX_PLAYERS; i++){
state->outpostPlayed = 0;
state->deckCount[i] = 0;
state->handCount[i] = 0;
handPos = 0;
state->whoseTurn = i;
handPos = rand()%(MAX_HAND) + 1;
for(j = 0; j < handPos; j++){
randomCard = rand()%(treasure_map+1);
state->hand[i][j] = randomCard;
state->handCount[i]++;
}
for(j = 0; j < (MAX_DECK-handPos); j++){
state->deck[i][j] = randomCard;
state->deckCount[i]++;
}
state->hand[i][handPos] = outpost;
state->handCount[i]++;
handCount = state->handCount[i]-1;
ret = cardEffect(outpost, 0, 0, 0, state, handPos, 0);
assert(ret == 0);
assert(state->outpostPlayed == 1);
assert(handCount == state->handCount[i]);
}
printf("All tests passed! \n\n");
return 0;
}
开发者ID:CS362-Winter-2016,项目名称:cs362w16_chenj2,代码行数:39,代码来源:cardtest4.c
示例6: main
int main (int argc, char** argv) {
struct gameState x;
int i;
int y[10] = {adventurer, gardens, embargo, village, minion, mine, cutpurse, sea_hag, feast, smithy};
printf ("gardens\n");
initializeGame(2, y, 2, &x);
i = cardEffect(gardens, 0, 0, 0, &x, 0, 0);
assert(i == -1);
assert(x.numActions == 1);
assert(numHandCards(&x) == 5);
assert(x.numBuys ==1); //nothing should change
return (0);
}
开发者ID:cs362sp15,项目名称:projects,代码行数:22,代码来源:cardtest4.c
示例7: main
int main(){
struct gameState g;
int i, ret, bonus;
bonus = 0;
int k[10] = {adventurer, gardens, embargo, village, minion, mine, cutpurse,
sea_hag, tribute,smithy};
printf ("Starting game.\n");
initializeGame(2, k, 5, &g);
//g.coins = 0;
g.embargoTokens[smithy] = 0;
g.hand[0][0] = embargo;
printf("handcount is %d \n", g.handCount[0]);
printf("coin is %d \n", g.coins);
assert(g.handCount[0] == 5);
assert(g.coins == 4);
//cardEffect(card, choice1, choice2, choice3, state, handPos, &coin_bonus)
//playCard(0,smithy,-1,-1, &g);
cardEffect(embargo, smithy, -1, -1, &g, 0, &bonus);
printf("handcount is %d \n", g.handCount[0]);
printf("coin is %d \n", g.coins);
printf("g.embargoTokens[smithy] is : %d \n", g.embargoTokens[smithy]);
assert( g.embargoTokens[smithy] == 1);
assert(g.coins == 6);
//assert(g.handCount[0] == 8);
//assert(g.numBuys == 2);
//assert(g.handCount[0] == 9);
printf ("embargo switch statement works \n");
return 0;
}
开发者ID:CS362-Winter-2016,项目名称:cs362w16_chenj2,代码行数:39,代码来源:cardtest3.c
示例8: main
int main() {
int k[10] = {adventurer, gardens, embargo, village, minion, mine, cutpurse,
sea_hag, tribute, smithy};
int players, player, handCount, deckCount, seed, handPos, coinBonus;
struct gameState state;
srand(time(NULL));
printf("Running Random Adventurer Test\n");
for (int i = 0; i < MAX_TESTS; i++) {
players = rand() % (MAX_PLAYERS - 2) + 2;
seed = rand();
coinBonus = 0;
handPos = rand() % 4;
player = i % (players);
initializeGame(players, k, seed, &state); //initialize Gamestate
// Initiate valid state variables
state.deckCount[player] = rand() % MAX_DECK; //Pick random deck size out of MAX DECK size
state.discardCount[player] = rand() % MAX_DECK;
state.handCount[player] = rand() % MAX_HAND;
// Copy state variables
handCount = state.handCount[player];
deckCount = state.deckCount[player];
cardEffect(adventurer, 1, 1, 1, &state, handPos, &coinBonus);
int result = validateStateAfterAdventurerDraw(&state, player, handCount, deckCount);
assert(result == 1);
}
printf("Tests Complete\n");
return 0;
}
开发者ID:CS362-Winter-2016,项目名称:cs362w16_farryr,代码行数:38,代码来源:randomtestadventurer.c
示例9: testDiscardFail
void testDiscardFail()
{
int turn1 = G->whoseTurn;
int turn2 = turn1 + 1;
//Assign first hand draw (deck must be identifiable)
G->hand[turn1][0] = copper;
G->hand[turn1][1] = baron;
G->hand[turn1][2] = copper;
G->hand[turn1][3] = copper;
G->hand[turn1][4] = copper;
//Each Deck position should be different (identification)
G->deck[turn1][0] = estate;
G->deck[turn1][1] = silver;
G->deck[turn1][2] = gold;
G->deck[turn1][3] = village;
G->deck[turn1][4] = minion;
//Set 2nd player to keep deck identifiable
G->deck[turn2][0] = estate;
G->deck[turn2][1] = estate;
G->deck[turn2][2] = copper;
G->deck[turn2][3] = copper;
G->deck[turn2][4] = copper;
G->deck[turn2][5] = tribute;
G->deck[turn2][6] = salvager;
G->deck[turn2][7] = adventurer;
G->deck[turn2][8] = baron;
G->deck[turn2][9] = remodel;
printf("\n*********Before card effect (With Failed Discard)***********\n");
displayState(G);
cardEffect(baron, 1, 0, 0, G, 0, 0);
printf("\n*********After card effect(With Failed Discard)***********\n");
displayState(G);
return;
}
开发者ID:cs362sp15,项目名称:projects,代码行数:38,代码来源:cardtest3.c
示例10: main
int main(int argc, char *argv[]) {
srand(atoi(argv[1]));
struct gameState g;
int k[10] = {smithy,adventurer,gardens,embargo,cutpurse,mine,ambassador,
outpost,baron,tribute};
int numPlayers = rand() % MAX_PLAYERS;
int seed = atoi(argv[1]);
int numTests = 300;
for(int i = 0; i < numTests; i++) {
initializeGame(numPlayers, k, seed, &g);
// g.deckCount[g.whoseTurn] = rand() % MAX_DECK;
// g.discardCount[g.whoseTurn] = rand() % MAX_DECK;
// g.handCount[g.whoseTurn] = rand() % MAX_HAND;
int startingHand = numHandCards(&g);
int startingDeck = g.deckCount[g.whoseTurn];
myassert(!cardEffect(adventurer, 0, 0, 0, &g, 0, 0),
"Adventurer returned the wrong value.");
myassert(numHandCards(&g) == startingHand + 2,
"Wrong number of treasure cards drawn by adventurer.");
int endingDiscard = g.discardCount[g.whoseTurn];
myassert(g.deckCount[g.whoseTurn] == startingDeck - endingDiscard - 2,
"Wrong number of treasure cards taken from deck by adventurer.");
seed++;
}
checkasserts();
}
开发者ID:TheTallPaul,项目名称:cs362sp16_melloc,代码行数:38,代码来源:randomtestadventurer.c
示例11: playCard
int playCard(int handPos, int choice1, int choice2, int choice3, gameState *state) {
// disallow improper phase or too few actions
if (state->phase != 0 || state->numActions < 1)
return -1;
//get card played
int card = handCard(handPos, state);
//check if selected card is an action
if (card < adventurer || card > treasure_map)
return -1;
//play card
int coin_bonus = 0; //tracks coins gain from actions
if (cardEffect(card, choice1, choice2, choice3, state, handPos, &coin_bonus) < 0)
return -1;
//update actions and coins (Treasure cards may be added with card draws)
state->numActions--;
updateCoins(state->whoseTurn, state, coin_bonus);
return 0;
}
开发者ID:cs362sp16,项目名称:cs362sp16_tolvstaa,代码行数:23,代码来源:dominion.c
示例12: main
int main () {
struct gameState state;
struct gameState *g = &state;
int card_returnValue;
int r;
int k[10] = {adventurer, gardens, embargo, village, minion, mine, cutpurse,
sea_hag, tribute, smithy};
srand(time(NULL));
r = rand();
printf("-----\nCard Test 2: Gardens\n-----\n");
// initialize game
int returnValue = initializeGame(2, k, r, g);
// make sure initialization is completed
assert (returnValue == 0);
// check return value
card_returnValue = cardEffect(gardens, 0, 0, 0, g, 0, 0);
assert(card_returnValue==-1);
printf("Test passed\n");
printf("Card Test 2: Gardens completed\n");
return 0;
}
开发者ID:CS362-Winter-2016,项目名称:cs362w16_wangjiad,代码行数:23,代码来源:cardtest2.c
示例13: main
int main() {
printf("%sTesting Smithy Card...%s\n", YELLOW, CLEAR);
int i = 0;
struct gameState state;
int game;
printf("%s\nSetting up game...%s\n", YELLOW, CLEAR);
game = initializeGame(2, kingdomCards(1, 2, 3, 4, 5, 6, 7, 8, 9, 10), 5, &state);
assertTrue(game == 0, "Game is initialized");
printf("%s\nSetting card to smithy...%s\n", YELLOW, CLEAR);
state.hand[0][0] = 13;
assertTrue(state.hand[0][0] == 13, "Test card is smithy");
printf("%s\nSaving initial hand count...%s\n", YELLOW, CLEAR);
int currentHandNum = state.handCount[0];
printf("%s\nCalling smithy card...%s\n", YELLOW, CLEAR);
cardEffect(13, 0, 0, 0, &state, i, NULL);
assertTrue(state.handCount[0] == currentHandNum+2, "+3 cards, discard 1");
return 0;
}
开发者ID:CS362-Winter-2016,项目名称:cs362w16_stinek,代码行数:23,代码来源:cardtest2.c
示例14: main
int main(int argc, char *argv[]){
struct gameState *state1 = malloc(sizeof(struct gameState)),
*state2 = malloc(sizeof(struct gameState));
int testseed, loops = 10000, i, handpos, bonus = 0, choice1, choice2, choice3;
char str[100];
if(argc > 1)
testseed = atoi(argv[1]);
else
testseed = time(NULL);
srand(testseed);
if (argc > 2)
loops = atoi(argv[2]);
printf("Testing great hall %d times...\n", loops);
for(i = 0; i < loops; i++){
// printf("test %d\n", i + 1);
if(initialize(state1, &handpos, &testseed))
printf("failed to initialize game states\n");
else{
memcpy(state2, state1, sizeof(struct gameState));
memset(str, '\0', sizeof(char) * 100);
sprintf(str, "Great hall card failed (number of players = %d, handpos = %d, original deck count = %d",state1->numPlayers, handpos, state1->deckCount[state1->whoseTurn]);
// myassert(impliment(state1), "testing implimentation failed\n");
impliment(state1, handpos);
cardEffect(card, 0, 0, 0, state2, handpos, &bonus);
sprintf(str, "%s error number %d)\n",str, check(state1, state2));
myassert(check(state1, state2), str);
}
}
(numFails()) ? printf("%d of %d tests FAILED\n", numFails(), loops) : printf("Test SUCCESSFUL\n");
return 0;
}
开发者ID:cs362sp16,项目名称:cs362sp16_pederson,代码行数:37,代码来源:randomtestcard2.c
示例15: testCardEffect_Smithy
//-------------------------------------------------------------------
//TEST
//-------------------------------------------------------------------
int testCardEffect_Smithy(int player, int testCard, int testCardPos, struct gameState *game) {
int testChoice1 = -1, testChoice2 = -1, testChoice3 = -1, testBonus = 0; // Vars passed to cardEffect
int prevValue = 0/*, success = 1*/, allPass = 1;
int oriPlayer = 0;
// Store Original Values
oriPlayer = game->whoseTurn;
/* After playing smithy player should have 3 new cards and smithy should be in their played cards pile */
prevValue = game->handCount[player];
cardEffect(testCard, testChoice1, testChoice2, testChoice3, game, testCardPos, &testBonus);
//assert(game->handCount[player] == (prevValue + 2)); // 3 new cards - 1 smithy card = 2 card difference
printf("Part 1...");
if (allPass) {
allPass = f_Assert((game->handCount[player] == (prevValue + 2)), "");
}
else {
f_Assert((game->handCount[player] == (prevValue + 2)), "");
}
//assert(game->playedCards[game->playedCardCount - 1] == testCard); // Smithy was the last card discarded
printf("Part 2...");
if (allPass) {
allPass = f_Assert((game->playedCards[game->playedCardCount - 1] == testCard), "");
}
else {
f_Assert((game->playedCards[game->playedCardCount - 1] == testCard), "");
}
// Restore original values
game->whoseTurn = oriPlayer;
// If all tests passed success = 1
if (allPass) { printf("Unit test was successfully completed.\n"); }
return allPass;
}
开发者ID:CS362-Winter-2016,项目名称:cs362w16_merrittm,代码行数:40,代码来源:cardtest2.c
示例16: oracle
void oracle(struct gameState state, int handCount, int discardCount, int actionCount)
{
cardEffect(village, 1, 1, 1, &state, 0, 0);
printf("handCount- B: %d A: %d\n", handCount, state.handCount[0]);
printf("discardCount- B: %d A: %d\n", discardCount, state.discardCount[0]);
printf("actionCount- B: %d A: %d\n", actionCount, state.numActions);
if(state.handCount[0] != handCount)
{
printf("Failed: handcount incorrect\n");
}
if(state.discardCount[0] != discardCount +1)
{
printf("Failed: discardcount incorrect\n");
}
if(state.numActions != actionCount+2)
{
printf("Failed: actioncount incorrect\n");
}
printf("\n");
return;
}
开发者ID:CS362-Winter-2016,项目名称:cs362w16_liusop,代码行数:24,代码来源:randomtestcard.c
示例17: oracle
void oracle(struct gameState state, int deckCount, int discardCount)
{
int treasure, i;
treasure = 0;
i = 0;
printf("Deck Treasures Located At: ");
for(i = 0; i < deckCount; i++)
{
if(state.deck[0][i] == copper || state.deck[0][i] == silver || state.deck[0][i] == gold)
{
printf("%d ", i);
}
}
printf("\n");
cardEffect(adventurer, 1, 1, 1, &state, 0, 0);
printf("Deck Count- B: %d A: %d\n", deckCount, state.deckCount[0]);
printf("Discard Count- B: %d A: %d\n\n", discardCount, state.discardCount[0]);
return;
}
开发者ID:CS362-Winter-2016,项目名称:cs362w16_bowenjos,代码行数:24,代码来源:randomtestadventurer.c
示例18: main
int main (int argc, char** argv) {
struct gameState x;
int i;
int y[10] = {adventurer, gardens, embargo, village, minion, mine, cutpurse, sea_hag, feast, smithy};
printf ("feast\n");
initializeGame(2, y, 2, &x);
i = cardEffect(feast, village, 0, 0, &x, 0, 0);
assert(i == 0);
assert(x.numActions == 1);
assert(numHandCards(&x) == 5);
assert(x.numBuys ==1);
assert(fullDeckCount(0, village, &x) == 1);
return (0);
}
开发者ID:cs362sp15,项目名称:projects,代码行数:24,代码来源:cardtest3.c
示例19: main
int main(){
printf("Random Test 1 (Council Room) Starting \n");
int k[10] = {adventurer, council_room, embargo, village, minion, mine, cutpurse,
sea_hag, tribute, smithy};
int i, j, n, players, player, handCount, deckCount, seed, address;
struct gameState state1;
struct gameState state2;
struct gameState state3;
for(i=0;i < MAX_TESTS;i++){
seed = rand();
players = rand() % 4;
initializeGame(players,k,seed,&state1);
state1.deckCount[player] = rand() % MAX_DECK;
state1.discardCount[player] = rand() % MAX_DECK;
state1.handCount[player] = rand() % MAX_HAND;
handCount = state1.handCount[player];
deckCount = state1.deckCount[player];
cardEffect(council_room,1,1,1,&state1);
}
for(i=0;i < MAX_TESTS;i++){
seed = rand();
players = rand() % 4;
initializeGame(players,k,seed,&state2);
state2.deckCount[player] = rand() % MAX_DECK;
state2.discardCount[player] = rand() % MAX_DECK;
state2.handCount[player] = rand() % MAX_HAND;
handCount = state2.handCount[player];
deckCount = state2.deckCount[player];
cardEffect(council_room,1,1,1,&state2);
}
for(i=0;i < MAX_TESTS;i++){
seed = rand();
players = rand() % 4;
initializeGame(players,k,seed,&state3);
state3.deckCount[player] = rand() % MAX_DECK;
state3.discardCount[player] = rand() % MAX_DECK;
state3.handCount[player] = rand() % MAX_HAND;
handCount = state3.handCount[player];
deckCount = state3.deckCount[player];
cardEffect(council_room,1,1,1,&state3);
}
printf("Random Test 1 Complete \n");
return 0;
}
开发者ID:Cthenninger,项目名称:CS362,代码行数:62,代码来源:randomtest1.c
示例20: main
int main()
{
int i, j, m;
int handPos, choice1, choice2, choice3, bonus, player;
handPos = choice1 = choice2 = choice3 = bonus = player = 0;
int trash1, trash2;
int seed = 1000;
int numPlayers = 2;
int k[10] = {adventurer, council_room, steward, gardens, mine, remodel, smithy, village, baron, great_hall};
struct gameState state, controlState;
initializeGame(numPlayers, k, seed, &state);
printf("\nTESTING Steward cardEffect\n");
//************** Test choice1 = 1: +2 cards **************
printf("\nTesting Choice: Draw Two Cards\n");
//Set gameState, choice, and call cardEffect
memcpy(&controlState, &state, sizeof(struct gameState));
choice1 = 1;
cardEffect(steward, choice1, choice2, choice3, &state, handPos, &bonus);
//Test handCount incremented by one
printf("Testing Hand Count\n");
if(state.handCount[player] == controlState.handCount[player] + 1)
{
printf("PASS: Expected Value: %d Actual Value: %d\n", controlState.handCount[player] + 1, state.handCount[player]);
}
else
{
printf("FAIL: Expected Value: %d Actual Value: %d\n", controlState.handCount[player] + 1, state.handCount[player]);
}
//Test deckCount decremented by two
printf("Testing Deck Count\n");
if(state.deckCount[player] == controlState.deckCount[player] - 2)
{
printf("PASS: Expected Value: %d Actual Value: %d\n", controlState.deckCount[player] - 2, state.deckCount[player]);
}
else
{
printf("FAIL: Expected Value: %d Actual Value: %d\n", controlState.deckCount[player] - 2, state.deckCount[player]);
}
//Test coins unchanged
printf("Testing Coin Count\n");
if(state.coins == controlState.coins)
{
printf("PASS: Expected Value: %d Actual Value: %d\n", controlState.coins, state.coins);
}
else
{
printf("FAIL: Expected Value: %d Actual Value: %d\n", controlState.coins, state.coins);
}
//************** Test choice1 = 2: +2 coins **************
printf("\nTesting Choice: Two Coins\n");
//Reset game state, set choice, and call cardEffect
memcpy(&state, &controlState, sizeof(struct gameState));
choice1 = 2;
cardEffect(steward, choice1, choice2, choice3, &state, handPos, &bonus);
//Test handCount decremented by one
printf("Testing Hand Count\n");
if(state.handCount[player] == controlState.handCount[player] - 1)
{
printf("PASS: Expected Value: %d Actual Value: %d\n", controlState.handCount[player] - 1, state.handCount[player]);
}
else
{
printf("FAIL: Expected Value: %d Actual Value: %d\n", controlState.handCount[player] - 1, state.handCount[player]);
}
//Test deckCount unchanged
printf("Testing Deck Count\n");
if(state.deckCount[player] == controlState.deckCount[player])
{
printf("PASS: Expected Value: %d Actual Value: %d\n", controlState.deckCount[player], state.deckCount[player]);
}
else
{
printf("FAIL: Expected Value: %d Actual Value: %d\n", controlState.deckCount[player], state.deckCount[player]);
}
//Test coins incremented by two
printf("Testing Coin Count\n");
if(state.coins == controlState.coins + 2)
{
printf("PASS: Expected Value: %d Actual Value: %d\n", controlState.coins + 2, state.coins);
}
else
{
printf("FAIL: Expected Value: %d Actual Value: %d\n", controlState.coins + 2, state.coins);
}
//.........这里部分代码省略.........
开发者ID:cr8zd,项目名称:cs362w16,代码行数:101,代码来源:cardtest4.c
注:本文中的cardEffect函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论