Prepare Capital Quest public edition and player manual
This commit is contained in:
1 parent
46f4b9cae0
commit
afa6f3c2a0
40 files changed
+1072
-106
No files matched your search
+21
-7
@@ -5,19 +5,33 @@
|
||||
static unsigned index_of(const char *code){unsigned i;for(i=0;i<50;++i)if(!strcmp(states[i].code,code))return i;assert(0);return 0;}
|
||||
int main(void)
|
||||
{
|
||||
unsigned seed,i,j,p,positions[4]={0},last[50],changes=0;
|
||||
unsigned seed,i,j,p,slot,previous,positions[4]={0},first[4]={0};
|
||||
unsigned transitions[4][4]={{0}},last[50],changes=0;
|
||||
U8 first_options[4];
|
||||
char a[160],b[ANSWER_SIZE];
|
||||
for(seed=1;seed<=2000;++seed){
|
||||
unsigned seen[50]={0};quiz_start(seed);
|
||||
unsigned seen[50]={0};quiz_start(seed);previous=4;
|
||||
for(i=0;i<50;++i){
|
||||
assert(order[i]<50);++seen[order[i]];quiz_options(order[i]);p=0;
|
||||
for(j=0;j<4;++j){unsigned k;assert(options[j]<50);if(options[j]==order[i]){++p;++positions[j];}for(k=0;k<j;++k)assert(options[k]!=options[j]);}
|
||||
assert(p==1);if(seed>1 && last[i]!=order[i])++changes;last[i]=order[i];
|
||||
assert(order[i]<50);++seen[order[i]];quiz_options(order[i]);p=0;slot=4;
|
||||
for(j=0;j<4;++j){unsigned k;assert(options[j]<50);if(options[j]==order[i]){++p;++positions[j];slot=j;}for(k=0;k<j;++k)assert(options[k]!=options[j]);}
|
||||
assert(p==1 && slot!=previous);
|
||||
if(i)++transitions[previous][slot];else ++first[slot];
|
||||
previous=slot;
|
||||
if(seed>1 && last[i]!=order[i])++changes;last[i]=order[i];
|
||||
}
|
||||
for(i=0;i<50;++i)assert(seen[i]==1);
|
||||
}
|
||||
for(i=0;i<4;++i)assert(positions[i]>20000);
|
||||
for(i=0;i<4;++i){
|
||||
assert(positions[i]>20000 && first[i]>300);
|
||||
for(j=0;j<4;++j)assert(i==j?transitions[i][j]==0:transitions[i][j]>6000);
|
||||
}
|
||||
assert(changes>90000);
|
||||
/* Replaying a seed must reset the remembered slot as well as the answers. */
|
||||
for(seed=1;seed<=32;++seed){
|
||||
quiz_start(seed);quiz_options(order[0]);memcpy(first_options,options,4);
|
||||
for(i=1;i<50;++i)quiz_options(order[i]);
|
||||
quiz_start(seed);quiz_options(order[0]);assert(!memcmp(first_options,options,4));
|
||||
}
|
||||
for(i=0;i<50;++i){
|
||||
assert(classify(i,states[i].capital)==2);
|
||||
strcpy(a,states[i].capital);
|
||||
@@ -43,6 +57,6 @@ int main(void)
|
||||
for(i=0;i<50;++i)assert(answered[i]==1);
|
||||
quiz_start(2710);assert(score==0 && corrections==0);
|
||||
for(i=0;i<50;++i)assert(!answered[i] && !responses[i][0]);
|
||||
printf("PASS: 2000 shuffles, 100000 option sets, all casing / known-wrong capitals, aliases, distance, bounds, scoring, reset.\n");
|
||||
printf("PASS: 2000 shuffles, 100000 option sets with no repeated correct slot, all 12 allowed slot transitions, replay reset, all casing / known-wrong capitals, aliases, distance, bounds, scoring, reset.\n");
|
||||
return 0;
|
||||
}
|
||||
Reference in new issue
Block a user