i7: sorting people by a number

So this short code gives errors. I have longer code that works, but

[code]“influence” by Andrew

room 1 is a room.

a person has a number called influence. Biff is a person. the influence of Biff is 2. McFly is a person. the influence of McFly is 3. Marty is a person. the influence of Marty is 1. Goldie is a person. the influence of Goldie is 3.

when play begins:
say “[random person with influence of 3].”;
repeat with X running from 1 to 3:
say “[X]: [number of people with influence of X], [list of people with influence of X.”;[/code]

This seems like it should semantically work, and related but more tangled code does. If I define cur-infl as variable and say

definition: an person (called p) is pickable: if influence of p is cur-infl: decide yes; decide no.

Then, random pickable person, list of pickable people, etc., works. But this seems a bit redundant, and I don’t like defining and twiddling a variable constantly. Can it be cut down? What syntactical trick am I missing?

Thanks!

What’s the error?

You could define a new relation verb.

Influentialness relates a person (called X) to a number (called Y) when the influence of X is Y. The verb to be influential at means the influentialness relation.

Now you can talk about “the list of people influential at 1”.

Sorting people by a number? What is this, 1984!?

-Wade

“I am not a number, I am free man!” (inspired by this).

Funny thing is, they used that line in the opening for every show but in the first episode he actually said, and in a quieter voice, “I am not a number. I am a person”.

Then again, consistency was always a pot shot with that series, and I still love it.

Anyhoo. Back to our scheduled programming.

I’ve never seen the show, but I know that the 1980 Apple II computer game based on it was designed to make the player have to hack it and guess at just how it worked to make progress. Jimmy Maher’s Digital Antiquarian has a whole series of posts about the game.

-Wade

/forgot to subscribe to the thread so missed this

This is found in 6G or 6L on compiling the above code.

[code]Problem. In the sentence ‘say “[random person with influence of 3].”’ , I was expecting to read a description of values, but instead found some text that I couldn’t understand - ‘person with influence of 3’.

I was trying to match this phrase:

a/-- random (person with influence of 3 - description of values)

But I didn’t recognise ‘person with influence of 3’.


Problem. In the sentence ‘say “[X]: [number of people with influence of X].”’ , I was expecting to read a description of values, but instead found some text that I couldn’t understand - ‘people with influence of X’.

I was trying to match this phrase:

number of (people with influence of x - description of values)

But I didn’t recognise ‘people with influence of x’.[/code]

I concur with Draconis’s “make a verb” solution above.

Or, better, make a property verb and skip the (unnecessary) relation:

The verb to be influential at means the influence property.

I forgot that was a thing! Very useful.

Welp, this is embarrassing. I missed Draconis’s response. Thanks, all, for the tips.