我尝试列出用户可能访问的可能方向。但是,对于故事的语气,不说"您可以向北和南方走",而是"您可以去洗手间和厨房"。
我找到了帽子代码,但仅显示指示。
Definition: a direction (called thataway) is viable if the room
thataway from the location is a room.
After looking:
say "you can go [list of viable directions]."
有什么想法?
绝对不是最好的方法,但是我也有一个类似的问题,我最终迭代了您创建的方向列表,并将每个房间添加到一个房间列表中,然后可以说:
nLooking is a number that varies. nLooking is 0.
After looking:
now nLooking is 1;
let accessibleRooms be a list of rooms;
let pDirections be list of viable directions;
repeat with dirToLookAt running through pDirections:
try silently going dirToLookAt;
if rule succeeded:
add the location of the player to accessibleRooms;
try silently going the opposite of dirToLookAt;
now nLooking is 0;
say "You can go to [accessibleRooms].".
Before going through a locked door when nLooking is 1:
stop the action.
我使用nlook阻止输出
(第一个开门)
它似乎已锁定。
寻找房间时可以访问。
if rule succeeded
检查Palyer是否能够去房间。如果是这样的情况
仅当一个人不制作混乱的地图时,这才能起作用,而与一个人的相反方向移动并不意味着一个人在同一房间里降落。一个人可能只是把玩家放回他来自...
的房间里我知道的迟到答案,但也许它可以帮助有同样问题的人:)