mirror of
https://github.com/caperren/school_archives.git
synced 2025-11-09 21:51:15 +00:00
Added Software Engineering II code
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
#include "dominion.h"
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
|
||||
int compare(const int* a, const int* b);
|
||||
|
||||
int main () {
|
||||
struct gameState G;
|
||||
struct gameState G2;
|
||||
|
||||
// Initialize G.
|
||||
|
||||
memcpy (&G2, &G, sizeof(struct gameState));
|
||||
|
||||
int ret = shuffle(0,&G);
|
||||
|
||||
if (G.deckCount[0] > 0) {
|
||||
assert (ret != -1);
|
||||
|
||||
qsort ((void*)(G.deck[0]), G.deckCount[0], sizeof(int), compare);
|
||||
qsort ((void*)(G2.deck[0]), G2.deckCount[0], sizeof(int), compare);
|
||||
} else
|
||||
assert (ret == -1);
|
||||
|
||||
assert(memcmp(&G, &G2, sizeof(struct gameState)) == 0);
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user