Change prompt generation to be more compatible with the advent430 branch.

This commit is contained in:
Eric S. Raymond 2023-03-22 17:09:14 -04:00
parent 1e05134b47
commit 5f7ce87040
79 changed files with 87 additions and 77 deletions

9
main.c
View file

@ -55,8 +55,13 @@ char *myreadline(const char *prompt)
* logfiles for testing purposes.
*/
/* Normal case - no script arguments */
if (settings.argc == 0)
return readline(prompt);
if (settings.argc == 0) {
char *ln = readline(prompt);
if (ln == NULL) {
fputs(prompt, stdout);
}
return ln;
}
char *buf = malloc(LINESIZE + 1);
for (;;) {

View file

@ -1631,7 +1631,7 @@ There is a little axe lying beside the bear.
The bear is locked to the wall with a golden chain!
>
You scored 251 out of a possible 430, using 271 turns.
You have reached "Junior Master" status.

View file

@ -652,7 +652,7 @@ mist. A notice posted on the bridge reads, "Stop! Pay troll!"
A burly troll stands by the bridge and insists you throw him a
treasure before you may cross.
>
You scored 105 out of a possible 430, using 109 turns.
Your score qualifies you as a novice class adventurer.

View file

@ -307,7 +307,7 @@ The blood-specked body of a huge green dead dragon lies to one side.
For crying out loud, the poor thing is already dead!
>
You scored 77 out of a possible 430, using 49 turns.
Your score qualifies you as a novice class adventurer.

View file

@ -2537,7 +2537,7 @@ best start wrapping this up.
OK
>
You scored 207 out of a possible 430, using 416 turns.
You may now consider yourself a "Seasoned Adventurer".

View file

@ -456,7 +456,7 @@ attack. He seems almost amused by your puny effort.
OK
>
You scored 61 out of a possible 430, using 81 turns.
Your score qualifies you as a novice class adventurer.

View file

@ -1479,7 +1479,7 @@ You're in Chamber of Boulders.
There are rare spices here!
>
You scored 119 out of a possible 430, using 238 turns.
Your score qualifies you as a novice class adventurer.

View file

@ -75,7 +75,7 @@ You can catch the bird, but you cannot carry it.
The little bird is now dead. Its body disappears.
>
You scored 32 out of a possible 430, using 10 turns.
You are obviously a rank amateur. Better luck next time.

View file

@ -327,7 +327,7 @@ The bird eyes you suspiciously and flutters away. A moment later you
feel something wet land on your head, but upon looking up you can see
no sign of the culprit.
>
You scored 113 out of a possible 430, using 57 turns.
Your score qualifies you as a novice class adventurer.

View file

@ -13,7 +13,7 @@ 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.
>
Now let's see you do it without suspending in mid-Adventure.
You scored 9031 out of a possible 430, using 0 turns.

View file

@ -13,7 +13,7 @@ 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.
>
Now let's see you do it without suspending in mid-Adventure.
You scored 10031 out of a possible 430, using 0 turns.

View file

@ -166,7 +166,7 @@ The dome is unclimbable.
You're in Hall of Mists.
>
You scored 63 out of a possible 430, using 24 turns.
Your score qualifies you as a novice class adventurer.

View file

@ -246,7 +246,7 @@ There is a Persian rug spread out on the floor!
The blood-specked body of a huge green dead dragon lies to one side.
>
You scored 65 out of a possible 430, using 32 turns.
Your score qualifies you as a novice class adventurer.

View file

@ -150,7 +150,7 @@ A huge green fierce snake bars the way!
There's nothing here it wants to eat (except perhaps you).
>
You scored 59 out of a possible 430, using 25 turns.
Your score qualifies you as a novice class adventurer.

View file

@ -58,3 +58,4 @@ Oh dear, you seem to have gotten yourself killed. I might be able to
help you out, but I've never really done this before. Do you want me
to try to reincarnate you?
>

View file

@ -1223,7 +1223,7 @@ Wicker cage
Black rod
Small bottle
>
You scored 77 out of a possible 430, using 190 turns.
Your score qualifies you as a novice class adventurer.

View file

@ -435,7 +435,7 @@ There is a large nest here, full of golden eggs!
The passage here is blocked by a recent cave-in.
>
You scored 67 out of a possible 430, using 66 turns.
Your score qualifies you as a novice class adventurer.

View file

@ -436,7 +436,7 @@ OK
OK
>
You scored 59 out of a possible 430, using 93 turns.
Your score qualifies you as a novice class adventurer.

View file

@ -1638,7 +1638,7 @@ OK
OK
>
You scored 77 out of a possible 430, using 263 turns.
Your score qualifies you as a novice class adventurer.

View file

@ -394,7 +394,7 @@ You are in a large chamber with passages to the west and north.
A formidable ogre bars the northern exit.
>
You scored 63 out of a possible 430, using 56 turns.
Your score qualifies you as a novice class adventurer.

View file

@ -109,7 +109,7 @@ OK
OK
>
You scored 32 out of a possible 430, using 25 turns.
You are obviously a rank amateur. Better luck next time.

View file

@ -57,7 +57,7 @@ You can't fill that.
Your bottle is already full.
>
You scored 32 out of a possible 430, using 10 turns.
You are obviously a rank amateur. Better luck next time.

View file

@ -1463,7 +1463,7 @@ A small velvet pillow lies on the ground.
You can't be serious!
>
You scored 191 out of a possible 430, using 241 turns.
You may now consider yourself a "Seasoned Adventurer".

View file

@ -2040,7 +2040,7 @@ A brilliant blue star sapphire is here!
>
>
You scored 257 out of a possible 430, using 337 turns.
You have reached "Junior Master" status.

View file

@ -1694,7 +1694,7 @@ Nothing happens.
Nothing happens.
>
You scored 311 out of a possible 430, using 291 turns.
You have reached "Junior Master" status.

View file

@ -796,7 +796,7 @@ There is food here.
>
>
You scored 61 out of a possible 430, using 121 turns.
Your score qualifies you as a novice class adventurer.

View file

@ -2145,7 +2145,7 @@ There is a ruby resting in a small cavity in the rock!
There is a Persian rug spread out on the floor!
>
You scored 271 out of a possible 430, using 365 turns.
You have reached "Junior Master" status.

View file

@ -2527,7 +2527,7 @@ best start wrapping this up.
OK
>
You scored 207 out of a possible 430, using 413 turns.
You may now consider yourself a "Seasoned Adventurer".

View file

@ -150,7 +150,7 @@ There is a way to explore that region without having to worry about
falling into a pit. None of the objects available is immediately
useful in discovering the secret.
>
You scored 54 out of a possible 430, using 27 turns.
Your score qualifies you as a novice class adventurer.

View file

@ -83,7 +83,7 @@ The grate is very solid and has a hardened steel lock. You cannot
enter without a key, and there are no keys nearby. I would recommend
looking elsewhere for the keys.
>
You scored 30 out of a possible 430, using 10 turns.
You are obviously a rank amateur. Better luck next time.

View file

@ -1849,7 +1849,7 @@ Do you want the hint?
Once you've found all the other treasures, it is no longer possible to
locate the one you're now missing.
>
You scored 91 out of a possible 430, using 297 turns.
Your score qualifies you as a novice class adventurer.

View file

@ -192,7 +192,7 @@ You can't kill the snake, or drive it away, or avoid it, or anything
like that. There is a way to get by, but you don't have the necessary
resources right now.
>
You scored 55 out of a possible 430, using 25 turns.
Your score qualifies you as a novice class adventurer.

View file

@ -74,7 +74,7 @@ Do you want the hint?
This section is quite advanced. Find the cave first.
>
You scored 30 out of a possible 430, using 11 turns.
You are obviously a rank amateur. Better luck next time.

View file

@ -2430,7 +2430,7 @@ Do you want the hint?
Don't go west.
>
You scored 339 out of a possible 430, using 397 turns.
Your score puts you in Master Adventurer Class C.

View file

@ -697,3 +697,4 @@ I am prepared to give you a hint, but it will cost you 2 points.
Do you want the hint?
>

View file

@ -35,7 +35,7 @@ OK
OK
>
You scored 32 out of a possible 430, using 5 turns.
You are obviously a rank amateur. Better luck next time.

View file

@ -11,7 +11,7 @@ down a gully.
Nothing happens.
>
You scored 32 out of a possible 430, using 1 turn.
You are obviously a rank amateur. Better luck next time.

View file

@ -33,7 +33,7 @@ Get what?
OK
>
You scored 32 out of a possible 430, using 3 turns.
You are obviously a rank amateur. Better luck next time.

View file

@ -32,7 +32,7 @@ OK
You are currently holding the following:
Tasty food
>
You scored 32 out of a possible 430, using 4 turns.
You are obviously a rank amateur. Better luck next time.

View file

@ -2508,7 +2508,7 @@ There is a message scrawled in the dust in a flowery script, reading:
There is a massive vending machine here, swung back to reveal a
southward passage.
>
You scored 343 out of a possible 430, using 406 turns.
Your score puts you in Master Adventurer Class C.

View file

@ -2595,7 +2595,7 @@ It is now pitch dark. If you proceed you will likely fall into a pit.
Your lamp has run out of power.
>
You scored 368 out of a possible 430, using 423 turns.
Your score puts you in Master Adventurer Class C.

View file

@ -1888,3 +1888,4 @@ Oh dear, you seem to have gotten yourself killed. I might be able to
help you out, but I've never really done this before. Do you want me
to try to reincarnate you?
>

View file

@ -21,7 +21,7 @@ There is a bottle of water here.
>
>
You scored 32 out of a possible 430, using 1 turn.
You are obviously a rank amateur. Better luck next time.

View file

@ -2509,7 +2509,7 @@ You are in a maze of little twisty passages, all different.
You are in a twisting little maze of passages, all different.
>
You scored 343 out of a possible 430, using 409 turns.
Your score puts you in Master Adventurer Class C.

View file

@ -618,7 +618,7 @@ Do you want the hint?
You can make the passages look less alike by dropping things.
>
You scored 71 out of a possible 430, using 113 turns.
Your score qualifies you as a novice class adventurer.

View file

@ -1316,7 +1316,7 @@ You're at brink of small pit.
>
>
You scored 179 out of a possible 430, using 224 turns.
You may now consider yourself a "Seasoned Adventurer".

View file

@ -152,7 +152,7 @@ A formidable ogre bars the northern exit.
The ogre, who despite his bulk is quite agile, easily dodges your
attack. He seems almost amused by your puny effort.
>
You scored 59 out of a possible 430, using 23 turns.
Your score qualifies you as a novice class adventurer.

View file

@ -720,7 +720,7 @@ Brass lantern
Leporine appendage
Platinum pyramid
>
You scored 101 out of a possible 430, using 108 turns.
Your score qualifies you as a novice class adventurer.

View file

@ -1146,7 +1146,7 @@ The plant indignantly shakes the oil off its leaves and asks, "Water?"
You can't be serious!
>
You scored 185 out of a possible 430, using 187 turns.
You may now consider yourself a "Seasoned Adventurer".

View file

@ -2631,7 +2631,7 @@ The grate is locked.
A mysterious recorded voice groans into life and announces:
"This exit is closed. Please leave via main office."
>
You scored 365 out of a possible 430, using 422 turns.
Your score puts you in Master Adventurer Class C.

View file

@ -2592,7 +2592,7 @@ A mysterious recorded voice groans into life and announces:
You're at "Y2".
>
You scored 365 out of a possible 430, using 414 turns.
Your score puts you in Master Adventurer Class C.

View file

@ -316,7 +316,7 @@ You are on the west side of the fissure in the Hall of Mists.
A crystal bridge spans the fissure.
>
You scored 67 out of a possible 430, using 43 turns.
Your score qualifies you as a novice class adventurer.

View file

@ -356,7 +356,7 @@ You are currently holding the following:
Brass lantern
Wicker cage
>
You scored 69 out of a possible 430, using 50 turns.
Your score qualifies you as a novice class adventurer.

View file

@ -1839,7 +1839,7 @@ You're in Hall of Mists.
Rough stone steps lead up the dome.
>
You scored 123 out of a possible 430, using 295 turns.
You have achieved the rating: "Experienced Adventurer".

View file

@ -1169,7 +1169,7 @@ Egg-sized emerald
It is now pitch dark. If you proceed you will likely fall into a pit.
>
You scored 169 out of a possible 430, using 187 turns.
You have achieved the rating: "Experienced Adventurer".

View file

@ -1475,7 +1475,7 @@ There is a Persian rug here, hovering in mid-air!
A brilliant blue star sapphire is here!
>
You scored 81 out of a possible 430, using 237 turns.
Your score qualifies you as a novice class adventurer.

View file

@ -170,7 +170,7 @@ You're in west pit.
There is a tiny little plant in the pit, murmuring "water, water, ..."
>
You scored 59 out of a possible 430, using 24 turns.
Your score qualifies you as a novice class adventurer.

View file

@ -387,7 +387,7 @@ You're at west end of Twopit Room.
The top of a 12-foot-tall beanstalk is poking out of the west pit.
>
You scored 63 out of a possible 430, using 50 turns.
Your score qualifies you as a novice class adventurer.

View file

@ -143,7 +143,7 @@ There is food here.
There is a bottle of water here.
>
You scored 47 out of a possible 430, using 18 turns.
Your score qualifies you as a novice class adventurer.

View file

@ -24,9 +24,10 @@ Is this acceptable?
OK
Can't open file /badfilename, try again.
File name:
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.

View file

@ -16,7 +16,7 @@ using that other version in order to resume that Adventure.
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.

View file

@ -25,9 +25,10 @@ Is this acceptable?
OK
Can't open file /, try again.
File name:
You're in front of building.
>
You scored 27 out of a possible 430, using 1 turn.
You are obviously a rank amateur. Better luck next time.

View file

@ -1,7 +1,7 @@
You're in front of building.
>
You scored 27 out of a possible 430, using 2 turns.
You are obviously a rank amateur. Better luck next time.

View file

@ -151,7 +151,7 @@ Set of keys
Brass lantern
Wicker cage
>
You scored 57 out of a possible 430, using 22 turns.
Your score qualifies you as a novice class adventurer.

View file

@ -1350,7 +1350,7 @@ There is a delicate, precious, ming vase here!
>
>
You scored 191 out of a possible 430, using 223 turns.
You may now consider yourself a "Seasoned Adventurer".

View file

@ -131,7 +131,7 @@ can now save a game and resume it at once (formerly you had to wait a
while first), but it now costs you a few points each time you save the
game. Saved games are now stored in much smaller files than before.
>
You scored 32 out of a possible 430, using 15 turns.
You are obviously a rank amateur. Better luck next time.

View file

@ -2076,7 +2076,7 @@ The grate is locked.
OK
>
You scored 391 out of a possible 430, using 345 turns.
Your score puts you in Master Adventurer Class B.

View file

@ -1024,7 +1024,7 @@ seems to open up.
The canyon runs into a mass of boulders -- dead end.
>
You scored 77 out of a possible 430, using 163 turns.
Your score qualifies you as a novice class adventurer.

View file

@ -1420,7 +1420,7 @@ Your lamp is now on.
You're at "Y2".
>
You scored 167 out of a possible 430, using 231 turns.
You have achieved the rating: "Experienced Adventurer".

View file

@ -912,7 +912,7 @@ mist. A notice posted on the bridge reads, "Stop! Pay troll!"
A burly troll stands by the bridge and insists you throw him a
treasure before you may cross.
>
You scored 75 out of a possible 430, using 140 turns.
Your score qualifies you as a novice class adventurer.

View file

@ -2105,7 +2105,7 @@ A small urn full of oil is embedded in the rock.
If you mean to use the Persian rug, it does not appear inclined to
cooperate.
>
You scored 265 out of a possible 430, using 358 turns.
You have reached "Junior Master" status.

View file

@ -2030,7 +2030,7 @@ There is nothing here with which to fill it.
The urn is now dark.
>
You scored 267 out of a possible 430, using 344 turns.
You have reached "Junior Master" status.

View file

@ -2015,7 +2015,7 @@ You are wandering aimlessly through the forest.
There is nothing here with which to fill the bottle.
>
You scored 267 out of a possible 430, using 340 turns.
You have reached "Junior Master" status.

View file

@ -305,7 +305,7 @@ Attack what?
The vending machine swings back to block the passage.
>
You scored 75 out of a possible 430, using 56 turns.
Your score qualifies you as a novice class adventurer.

View file

@ -602,7 +602,7 @@ The top of a 12-foot-tall beanstalk is poking out of the west pit.
What do you want to do with the water?
>
You scored 65 out of a possible 430, using 85 turns.
Your score qualifies you as a novice class adventurer.

View file

@ -218,7 +218,7 @@ You're outside grate.
The grate is open.
>
You scored 30 out of a possible 430, using 37 turns.
You are obviously a rank amateur. Better luck next time.

View file

@ -514,7 +514,7 @@ With what? Your bare hands?
Feed what?
>
You scored 103 out of a possible 430, using 88 turns.
Your score qualifies you as a novice class adventurer.

View file

@ -2628,7 +2628,7 @@ It is now pitch dark. If you proceed you will likely fall into a pit.
You're in Plover Room.
>
You scored 342 out of a possible 430, using 423 turns.
Your score puts you in Master Adventurer Class C.

View file

@ -314,7 +314,7 @@ You are wandering aimlessly through the forest.
You're at end of road.
>
You scored 30 out of a possible 430, using 45 turns.
You are obviously a rank amateur. Better luck next time.