ANSWER TO EXERCISE 8 | |
This is a prime candidate for using variable strings @nn. Briefly: at the head of the source, define Lowstring east_str "east"; Lowstring west_str "west";and then add two more routines to the game, [ NormalWorld; String 0 east_str; String 1 west_str; ]; [ ReversedWorld; String 0 west_str; String 1 east_str; ];where NormalWorld is called in Initialise or to go back to normal, and ReversedWorld when the reflection happens. Write @00 in place of east in any double-quoted printable string, and similarly @01 for west. It will be printed as whichever is currently set. (Inform provides up to 32 such variable strings.) |