MantisBT - Core Inform
|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0000584||Core Inform||Phrases and functional programming||public||2011-02-25 07:07||2014-05-07 07:34|
|Target Version||Fixed in Version||6L02|
|Effect||(serious/mild) Game compiles but misbehaves|
|Summary||0000584: Number of turns since an action can be both zero and more than zero simultaneously|
|Description||I was trying to get more understanding of a different issue I reported, so I put together the following code to test some assumptions. The test shows that the evaluation of the number of turns since an action has occurred obeys very strange rules that may not be functioning as intended.|
Note that the first every turn rule always prints a sentence BEFORE the pebble has been examined. This behavior seems to occur for any positive number of turns other than 1 (e.g. "less than 3 turns"). If the test is changed to "less than 0 turns", the sentence is not printed.
Also note that in the second every turn rule, no conditions evaluate as true before the pebble is examined, but AFTER the pebble is examined, BOTH the zero turns test and one of the more-than-zero turns tests will evaluate to true, producing output like "The pebble has been examined for zeroone turns."
|Minimal Source Text To Reproduce||"Test Story" by "Otis T. Dog"|
Noplace is a room.
A pebble is here.
[always evaluates true when pebble has not been examined]
if we have examined the pebble for less than 1 turn, say "The pebble has been examined for less than one turn. "
say "The pebble has been examined for ";
if we have examined the pebble for 0 turns, say "zero"; [always evaluates true after pebble has been examined]
if we have examined the pebble for 1 turn, say "one";
if we have examined the pebble for 2 turns, say "two";
if we have examined the pebble for 3 turns, say "three";
if we have examined the pebble for more than 3 turns, say "many";
say " turns."
Test me with "z / x pebble / z / z / z / z".
|Additional Information||I could not figure out a way to directly show what Inform thought the number of turns since an event was, which is why I had to go about it indirectly. I would have liked to be able to evaluate "[the number of turns we have examined the pebble]" or something similar.|
|Tags||No tags attached.|
|2011-02-25 07:07||otistdog||New Issue|
|2011-02-27 19:39||EmacsUser||Note Added: 0001057|
|2011-02-27 19:39||EmacsUser||Status||new => confirmed|
|2014-01-19 14:35||graham||Note Added: 0002335|
|2014-01-19 14:35||graham||Status||confirmed => resolved|
|2014-01-19 14:35||graham||Resolution||open => fixed|
|2014-01-19 14:35||graham||Assigned To||=> graham|
|2014-05-07 07:34||jmcgrew||Fixed in Version||=> 6L02|
|2014-05-07 07:34||jmcgrew||Status||resolved => closed|