I have a table with 13 entries, but based on a variable (values -1, 0, 1) I would want to return from items 1-11, 2-12, or 3-13 respectively. So the variable value would essentially tell the generator to ignore some entries from the head or tail of the list. Is there a way to accomplish this in Perchance?

  • cwiggins999@lemmy.worldOP
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    2 months ago

    Thanks for these solutions - clearly I have a lot to learn about Perchance, and some of these techniques will be helpful with some things I want to do in the future. I just discovered Perchance within the last week and really finding it useful for some tools for gaming.

    I came up with this solution after posting the question - I created a “showhead” and “showtail” variable and set them to 0 or 1 based on my input field value, then tagged just the first and last list entries with “conditional odds” based on that value - like

    lastitem ^[showtail]