hello!
i could bore you all with my various excuses, but quite frankly i am absolutely sure this is a question where i can either spend 5 hours wandering through the weeds getting increasingly confused, or somebody can come along and point me to the answer in 15 seconds or less and then we both have a good laugh about how i missed something so blatantly obvious. so please bear with me for a second on this one.
what i’m aiming to do is to more or less go
"hello computer. consider the following variables, which are all numbers we’ve been keeping track of going up and down this whole time: $alpha, $beta, $gamma and $delta. please tell me which of them is the highest number.
if $alpha is the highest number, set the variable $winner to alphawins. if $beta is the highest number, set variable $winner to betawins, etc."
i then know how to have it display different text for each - “if $winner’s value is alphawins, display this text; if $winner’s value is betawins display this text etc etc” - that’s easy enough to spot in the various cookbooks.
i am sure that given enough rubbing my two remaining brain cells together, i could create an absolute abomination of rickety code that would make intro to compsci professors around the world begin to scream. but i’m guessing that a) there has GOT to be a better way to do it than an extended jenga tower of “okay computer is $alpha greater than $beta, if not discard $alpha from the list, if $alpha is see if $alpha is greater than $gamma…”, b) if that really is the best way to do that in Harlowe, someone has probably written a macro function as to spare everyone from the sheer gory spectacle of making the computer do that level of busywork.
…and while computers have advanced to the point where making them do that level of busywork is comparatively very little to tax any CPU - i would imagine that you have to get way more complicated in Twine/Harlowe before you actually have to consider things like optimization - i would rather not create some code that makes actual programmers begin to spontaneously weep in despair when they are in its close proximity. in essence i am doing the programming equivalent of the first scene in an infomercial. all of these variables have just fallen over into my lap, so it’s time to look at the camera while shaking my head in despair and putting my hands on my hips because there’s got to be a better way!, so please someone come tell me about the as-seen-on-tv storage solution that will solve all my problems.
again, this is likely blatantly obvious - it’s probably something where it may be all i need is to be told the term that this function lives under in twine 2/harlowe! but i’ve definitely reached the “can’t see forest for the trees” level of brain scramble trying to find it. i wholeheartedly invite everyone to point out the super obvious thing i’ve missed while pointing and laughing at me for it.
thank you all so much in advance!