Thanks everyone for bearing with my questions so far!
I’ve got a magnetic poetry minigame that looks like this…
Some magnets are in the Kitchen. Understand "magnet" as the magnets. The description of the magnets is "Tiny flat magnets, each with a word printed in black type on a white background. Currently, they are ordered to read '[magnetic poetry]'."
The magnetic poetry is a text that varies. When play begins: now the magnetic poetry is "a day summers to".
Rearranging it to say is an action applying to one thing and one topic. Understand "rearrange [something] to say [text]" or "arrange [something] to say [text]" or "rearrange [something] to read [text]" or "arrange [something] to read [text]" or "move [something] to say [text]" or "move [something] to read [text]" as rearranging it to say.
Check rearranging it to say:
if the noun is the magnets:
if the the player's command matches the regular expression "((to|a|summers|day) ?){4}":
continue the action;
otherwise:
say "Not with the magnets you currently have!";
stop the action;
otherwise:
say "That doesn't seem like a good idea...";
stop the action.
Carry out rearranging it to say:
now magnetic poetry is "[text matching regular expression]".
Report rearranging it to say:
say "You rearrange the magnets to say '[magnetic poetry]'.";
…but for some reason, the “carry out” seems to be happening even if the check fails?
>arrange magnets to say "to a summers day"
You rearrange the magnets to say "to a summers day".
>x magnets
Tiny flat magnets, each with a word printed in black type on a white background. Currently, they are ordered to read "to a summers day".
>arrange magnets to say "a summers to day"
You rearrange the magnets to say "a summers to day".
>x magnets
Tiny flat magnets, each with a word printed in black type on a white background. Currently, they are ordered to read "a summers to day".
>arrange magnets to say butt
Not with the magnets you currently have!
>x magnets
Tiny flat magnets, each with a word printed in black type on a white background. Currently, they are ordered to read "".
The value of “magnetic poetry” shouldn’t be reset unless the regex matches, but for some reason it’s getting reset to the (in this case empty) regex - how come?
(By the way, if anyone has suggestions for other synonyms of rearrange I will add those in. I’m also aware that “summers summers summers summers” would be valid, but can’t figure out how to prevent it and don’t really consider it worth the time to do so.)