# %d of %d "random" messages %d of %d "class" messages
# %d of %d hints %d of %d turn thresholds'
- RESUME_ABANDON: 'To resume an earlier Adventure, you must abandon the current one.'
+- BAD_SAVE: 'Oops, that does not look like a valid save file.'
- VERSION_SKEW: |-
I'm sorry, but that Adventure was begun using Version %d.%d of the
save file format, and this program uses Version %d.%d. You must find an instance
IGNORE(fread(&save, sizeof(struct save_t), 1, fp));
fclose(fp);
- if (save.version != SAVE_VERSION) {
+ if (memcmp(save.magic, ADVENT_MAGIC, sizeof(ADVENT_MAGIC)) != 0)
+ rspeak(BAD_SAVE);
+ else if (save.version != SAVE_VERSION) {
rspeak(VERSION_SKEW, save.version / 10, MOD(save.version, 10), SAVE_VERSION / 10, MOD(SAVE_VERSION, 10));
} else if (!is_valid(save.game)) {
rspeak(SAVE_TAMPERING);
--- /dev/null
+
+Welcome to Adventure!! Would you like instructions?
+
+> n
+
+You are standing at the end of a road before a small brick building.
+Around you is a forest. A small stream flows out of the building and
+down a gully.
+
+> resume
+Can't open file y, try again.
+
+Oops, that does not look like a valid save file.
+
+You're in front of building.
+
+>
+You scored 32 out of a possible 430, using 1 turn.
+
+You are obviously a rank amateur. Better luck next time.
+
+To achieve the next higher rating, you need 14 more points.
--- /dev/null
+## Resume from filename withoy the right magic at the front
+# SPDX-FileCopyrightText: Eric S. Raymond <esr@thyrsus.com>
+# SPDX-License-Identifier: BSD-2-Clause
+#NOCOMPARE advent430 doesn't have this test
+n
+resume
+y
+../main.o