if (sect == 10) {
CLSSES = CLSSES + 1;
if (CLSSES > CLSMAX)
- BUG(TOO_MANY_CLASS_OR_TURN_MESSAGES);
+ BUG(TOO_MANY_CLASS_OR_TURN_MESSAGES);
CTEXT[CLSSES] = LINUSE;
CVAL[CLSSES] = loc;
continue;
long loc;
while ((loc = GETNUM(NULL)) != 0) {
if (is_set(COND[loc], K))
- BUG(LOCATION_HAS_CONDITION_BIT_BEING_SET_TWICE);
+ BUG(LOCATION_HAS_CONDITION_BIT_BEING_SET_TWICE);
COND[loc] = COND[loc] + (1l << K);
}
}
HNTMAX = 0;
while ((K = GETNUM(database)) != -1) {
if (K <= 0 || K > HNTSIZ)
- BUG(TOO_MANY_HINTS);
+ BUG(TOO_MANY_HINTS);
for (int I = 1; I <= 4; I++) {
HINTS[K][I] = GETNUM(NULL);
} /* end loop */
static void write_file(FILE* header_file)
{
- int MAXDIE;
- for (int i = 0; i <= 4; i++) {
- long x = 2 * i + 81;
- if (RTEXT[x] != 0)
- MAXDIE = i + 1;
- }
-
-
fprintf(header_file, "#ifndef DATABASE_H\n");
fprintf(header_file, "#define DATABASE_H\n");
fprintf(header_file, "\n");
fprintf(header_file, "#define TABSIZ 330\n");
fprintf(header_file, "#define HNTSIZ 20\n");
fprintf(header_file, "#define TOKLEN %d\n", TOKLEN);
- fprintf(header_file, "#define MAXDIE %d\n", MAXDIE);
fprintf(header_file, "\n");
fprintf(header_file, "\n");
fprintf(header_file, "#endif\n");
}
+void bug(enum bugtype num, const char *error_string)
+{
+ fprintf(stderr, "Fatal error %d, %s.\n", num, error_string);
+ exit(EXIT_FAILURE);
+}
+
int main(void)
{
FILE* database = fopen("adventure.text", "r");