consumable list only providing one item

https://perchance.org/tee--temp#edit

What's wrong here?

https://perchance.org/tee--temp#edit

Why does it say "no more items in the consumable 'Thing' list)"?

2 points · 3 comments · view on lemmy.world

3 Comments

Almaumbria@lemmy.world · 2 pts · 213d (4 replies)
[ removed ]
thargas@lemmy.world · 1 pts · 212d (3 replies)

Thanks @Almaumbria.

Unfortunately, it's not quite what I wanted. I'm wanting the effect of a consumable list where the elements are all the combinations of Adjective+Noun. I think I'll have to figure out how to iterate through each of Adjective and Noun and construct a new list with all the combinations and stash that. I've not written an function like Thing() before, so I'll have to think about that.

Almaumbria@lemmy.world · 1 pts · 212d (2 replies)
[ removed ]
thargas@lemmy.world · 1 pts · 212d (1 reply)

That's looking very promising! I can't try it right now, but I think it'll do, once I parameterize the function to allow passing in the two lists to be combined.

Thanks muchly!

thargas@lemmy.world · 2 pts · 211d

Yes. That works great! Thanks again!

Since I'm wanting to be able to use this multiple times, for various lists, I end up with:

AdjectiveNoun(Adj, Noun)=>
  let combo=[];
  for(const a of Adj.selectAll) {
    for(const n of Noun.selectAll) {
      combo.push([a,n].join(' '));
    };
  };
  return [joinlists(combo).consumableList];