コード例 #1
0
ファイル: cardtest1.c プロジェクト: orst-iqbald/cs362s15
//tests cardSmithy()
int main() {
    int player = 0;
    struct gameState* state = malloc(sizeof(struct gameState));
    state->whoseTurn = player;
    state->discardCount[player] = 0;
    int handpos = 0;
    int res;      //return value of function
		
	printf("\ncardtest1\n");
    
    //play smithy card when it's the only card in the player's hand
    state->hand[player][0] = smithy;
    state->handCount[player] = 1;
    loadDeck(state);
    res = cardSmithy(state, handpos);
    assert(res == 0);
    assert(state->deckCount[player] == 2);
    if (state->discardCount[player] != 1)
		printf("discardCount = %i, expected 1\n", state->discardCount[player]);
    assert(state->handCount[player] == 3);
    
    return 0;
}
コード例 #2
0
ファイル: parse_write.cpp プロジェクト: magnesj/opm-common
int main(int argc, char** argv) {
    for (int iarg = 1; iarg < argc; iarg++)
        loadDeck( argv[iarg] );
}