Files

19 lines
700 B
C

#ifndef QUIZ_H
#define QUIZ_H
#define BONE_COUNT 28
#define ANSWER_SIZE 34
typedef unsigned char U8;
typedef struct { const char *name; const char *hint; const char *aliases; } Bone;
extern const Bone bones[BONE_COUNT];
extern U8 order[BONE_COUNT], options[4], question, score, corrections;
extern U8 answered[BONE_COUNT], correct[BONE_COUNT], corrected[BONE_COUNT];
extern char responses[BONE_COUNT][ANSWER_SIZE];
extern unsigned random_state;
void quiz_start(unsigned seed);
unsigned quiz_random(unsigned bound);
void quiz_options(U8 bone);
void normalize(const char *in,char *out);
U8 classify(U8 bone,const char *answer);
void quiz_record(U8 bone,const char *answer,U8 right,U8 spelling);
#endif