Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000584Core InformPhrases and functional programmingpublic2011-02-25 07:072014-05-07 07:34
Assigned Tograham 
Platformx86OSWindowsOS Version7
Product Version6G60 
Target VersionFixed in Version6L02 
Summary0000584: Number of turns since an action can be both zero and more than zero simultaneously
DescriptionI 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]
Every turn:
	if we have examined the pebble for less than 1 turn, say "The pebble has been examined for less 
than one turn. "

Every 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 InformationI 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.
TagsNo tags attached.
Effect(serious/mild) Game compiles but misbehaves
Attached Files

- Relationships

-  Notes
EmacsUser (manager)
2011-02-27 19:39

The first every turn rule is behaving as expected (see my late reply 0000559:0001055). On the other hand, the I7 line

- - - -
if we have examined the pebble for 0 turns, say "zero";
- - - -

compiles to

- - - -
 if (TestSinglePastState(0, 1, false, 2)) { say__p=1;ParaContent(); print (PrintText) SC_13; .L_Say4; .L_SayX4; }
- - - -

when it ought to be

- - - -
 if (TestSinglePastState(0, 1, false, 2) == 0) { say__p=1;ParaContent(); print (PrintText) SC_13; .L_Say4; .L_SayX4; }
- - - -

So, confirmed.
graham (administrator)
2014-01-19 14:35

The 0 turns case is fixed, that being the bug here.

- Issue History
Date Modified Username Field Change
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

Copyright © 2000 - 2010 MantisBT Group
Powered by Mantis Bugtracker