I am now working on a new ‘game’, in which new directions are crucial, namely ‘clockwise’ and ‘counter-clockwise’, because this is how some of the rooms are configured. When I created the directions, I CLEARLY stated that one was the opposite of the other, and did it again in reverse order as per the manual. As the rooms make a circle, I thought it would be enough to simply state that each one was counter-clockwise of the next, etc. I thought that the program would automatically make the exits two-way(as it does with east-west, etc). I found out in testing that this was wrong–though I clearly stated that clockwise was the opposite of counter-clockwise, and I could move counter-clockwise, I could not go clockwise…?? I corrected the problem by adding a ‘clockwise’ exit to each ‘counter-clockwise’ one. It worked, but it seemed rather redundant—and I could not find anywhere in the manual where it explicitly said I had to do this. Did I misunderstand something?
I’m not having a problem with that, in this code:
[code]Clockwise is a direction. Clockwise has opposite counter-clockwise. Understand “c” as clockwise.
Counter-clockwise is a direction. Counter-clockwise has opposite clockwise. Understand “cc” as counter-clockwise.
Winter is clockwise of Autumn. Autumn is clockwise of Summer. Summer is clockwise of Spring. Spring is clockwise of Winter.[/code]
There were two mistakes I made when I was doing this; I don’t know if one of those might be what you encountered. The first was that one time I left out the hyphen in “counter-clockwise.” The second was that I typed
Understand "cc" as clockwise.
instead of “counter-clockwise,” and then I couldn’t understand why I kept going in the same direction.
Anyway, if this isn’t helpful, you could post the part of your code that wasn’t working so we can have a look at it.
Okay, you are using ‘has’ instead of ‘is’. The manual uses ‘is’ which is what I followed. My code–
Clockwise is a direction. The opposite of clockwise is counter-clockwise.
Counter-clockwise is a direction. The opposite of counter-clockwise is clockwise.
Understand "cw" as clockwise. Understand "cc" as counter-clockwise. Understand "counterclockwise" as counter-clockwise.
Index map with clockwise mapped as east.
I’ll try yours.
Okay I think I found what the error was–I had moved all of the code mapping out the rooms to a spot above the lines where I defined the directions. So I think counter-clockwise got defined by my assertions, but clockwise did not appear until after the rooms were defined. Could this have been the error?
Yes, that looks like it–this doesn’t work.
[code]Winter is clockwise of Autumn. Autumn is clockwise of Summer. Summer is clockwise of Spring. Spring is clockwise of Winter.
Clockwise is a direction. Clockwise has opposite counter-clockwise. Understand “c” as clockwise.
Counter-clockwise is a direction. Counter-clockwise has opposite clockwise. Understand “cc” as counter-clockwise.[/code]
Good job tracking down the error. In many cases the order you define things doesn’t matter, but there are a few cases where it does. Sometimes this is obvious–something won’t compile because you haven’t defined a crucial term yet–but this one was tricky.