Finding an object by value

Just trying to select the object that has a given value; I can’t reduce the value to an adjective because it could be anything. For some reason I can’t figure out the syntax to do this. Like so:

[code]A thing has a number called the cost.

The gift shop is a room.

The shell is in the gift shop. The cost of the shell is 1.

The pearl is in the gift shop. The cost of the pearl is 100.

The black pearl is in the gift shop. The cost of the black pearl is 1000.

The player has a number called the spending money. The spending money of the player is 100.

When play begins:
let X be a random thing with a cost of the spending money of the player;
say “You can afford [X].”[/code]

This requires a new verb. See chapter 14.7.

The verb to cost (it costs, they cost, it is costing) implies the cost property.

You could also do it with an adjective:

Definition: a thing is affordable if the cost of it is not greater than the spending money of the player.

Thus:

When play begins:
	let X be a random thing that costs the spending money of the player;
	say "You can afford [the X].";
	say "Actually, you can afford [the list of affordable things]."

Nicely done.

actually

Let x be a random affordable thing;

is better, because as it stands it only selects a thing that costs exactly what you can have.

The verb method is better because I need to refer to any value of the property (the spending-money situation is only an example).