intfiction.org

The Interactive Fiction Community Forum
It is currently Mon Sep 22, 2014 5:09 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Sun Dec 30, 2012 6:49 am 
Offline

Joined: Sat Nov 17, 2012 6:58 pm
Posts: 17
Please tell me I've neglected something simple and obvious. I'm terrible with math, just tell me where I went wrong. I'm beyond caring how embarrassing the answer is.

Problem: greater than one things comes out as any number of things (including one thing), fewer than two things does not recognize one thing.

Full test source in spoiler below.

Spoiler: show
Code:
The top of the shaft is a room. The bottom of the shaft is a room.  The bottom of the shaft is down from the top of the shaft.

The description of the top of the shaft is "There is a bright red button here, cordoned off by yellow caution tape and frantically scrawled warnings in red paint and what could either be black marker ink or something more sinister and dire. You ache to know the forbidden pleasures of the button."

An orange is in the top of the shaft. An apple is in the top of the shaft. A durian is in the top of the shaft.

A red herring is in the top of the shaft. The red herring is fixed in place. The description of the red herring is "It's glued to the wall. Also it seems more blue than red to you."

TrapdoorState is a truth state that varies. TrapdoorState is false.

The button is scenery in the top of the shaft. The description of the button is "You can't see any such thing. Oh, wait, there it is." The button can be pushed or unpushed. The button is unpushed.

Yourself is not portable.

Instead of pushing the button:
	if the button is pushed:
		say "As you unpush the button, a voice booms through a loudspeaker:[paragraph break]'CHANGE PLACES!'[paragraph break]The [list of things in the bottom of the shaft] [if there are fewer than two things in the bottom of the shaft]is[end if][if there are greater than one things in the bottom of the shaft]are[end if] tossed into the air, and the shaft partition is yanked out of its reclusion, catching the produce and giving palpable floorness to the room again.";
		now the button is unpushed;
		now all things in the bottom of the shaft are in the top of the shaft instead;
	if the button is unpushed:
		now the button is pushed;
		say "You dig into the steel hull plating above with your toes, clinging firmly to the ceiling, and push the button. The trapdoor -- which gave the room its downward end-plane -- slams sideways into its recessed housing with a loud bang, effectively removing the entire floor's floorness.[paragraph break]";
		if there are fewer than 2 portable things in the top of the shaft:
			say "The [list of portable things in the top of the shaft] falls to the bottom of the shaft.";
		if there are greater than 1 portable things in the top of the shaft:
			say "The [list of portable things in the top of the shaft] fall to the bottom of the shaft.";
		now all portable things in the top of the shaft are in the bottom of the shaft.

Test me with "push button / push button / take apple / take durian / l / push button / l / push button"


Wait, I've finally found the "exactly 1 thing" diction. Too exasperated to try it and move on at the moment, so I'm posting anyway.

Also, does Inform acknowledge "more than"/"less than" or doesn't it (or is it somewhere in the middle)?


Last edited by Lz_erk on Sun Dec 30, 2012 11:22 am, edited 1 time in total.

Top
 Profile Send private message  
 
PostPosted: Sun Dec 30, 2012 10:50 am 
Offline

Joined: Tue Mar 09, 2010 2:34 pm
Posts: 3086
Location: Burlington, VT
Changing your "greater than"s to "more than"s seems to solve the problem. I'm not sure why "greater than" does what it does, though.


Top
 Profile Send private message  
 
PostPosted: Sun Dec 30, 2012 11:17 am 
Offline

Joined: Sat Nov 17, 2012 6:58 pm
Posts: 17
Superlative and hyperbolic thanks yet again, mattw.

I tried more and less, also greater and fewer, but I didn't try mixing them. So a recap for anyone else having this problem, in this context at least, it's "fewer than" and "more than."


Top
 Profile Send private message  
 
PostPosted: Sun Dec 30, 2012 11:47 am 
Offline

Joined: Sat Jan 23, 2010 4:56 pm
Posts: 3389
I'm not sure why "greater than" is doing that either. It's not a syntactic confusion, though -- I7 is generating the right code, except for the comparison operator. "less than" is even wronger; it *also* generates a >=

Note that this has nothing to do with the "greater than" numerical relation, which is correct. This looks like a missing case in the object description generator.

I'll file a bug on this.


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: Bing [Bot] and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group