this post was submitted on 04 Dec 2023
1 points (100.0% liked)

Perchance - Create a Random Text Generator

0 readers
1 users here now

⚄︎ Perchance

This is a Lemmy Community for perchance.org, a platform for sharing and creating random text generators.

Feel free to ask for help, share your generators, and start friendly discussions at your leisure :)

See this post for the Complete Guide to Posting Here on the Community!


Rules

1. Please follow the Lemmy.World instance rules.

2. Be kind and friendly.

  • Please be kind to others on this community (and also in general), and remember that for many people Perchance is their first experience with coding. We have members for whom English is not their first language, so please be take that into account too :)

3. Be thankful to those who try to help you.

  • If you ask a question and someone has made a effort to help you out, please remember to be thankful! Even if they don't manage to help you solve your problem - remember that they're spending time out of their day to try to help a stranger :)

4. Only post about stuff related to perchance.

  • Please only post about perchance related stuff like generators on it, bugs, and the site.

Have fun generating! ⚄︎

founded 1 year ago
MODERATORS
 

There seems to be a bug with creating a consumable list, then using .evaluateItem from it doesn't consume the item.

Demo:

items
  a
  b
  c
  
output
  $output = [this.getRawListText.split('\n').slice(2).join('\n')]
  A: [x = items.consumableList, ''] [x.evaluateItem] [x.evaluateItem] [x.evaluateItem] [x.evaluateItem]<br>
  B: [x = items.consumableList, ''] [x] [x] [x] [x]<br>
  C: [x = items.consumableList, ''] [x.selectOne] [x.selectOne] [x.selectOne] [x.selectOne]
  • A doesn't work
  • B and C Works

I think it is because .evaluateItem essentially converts the consumable list to text, which will not consume it, although it should do a .selectOne (a reference post) behind the scenes which should consume from the list, but it is not working.

no comments (yet)
sorted by: hot top controversial new old
there doesn't seem to be anything here