Hey everyone!

I wanted to share a little side project Iโ€™ve been working on: a Planet Zoo Animal Picker. Itโ€™s a simple tool designed to help you choose a random animal for your Planet Zoo game.

I know there are already tools out there, and mine isnโ€™t necessarily better, but itโ€™s something I created and Iโ€™m proud of it. Itโ€™s just a fun little project I wanted to share with the community.

Itโ€™s written in Vue/Quasar, src

Feel free to check it out, and for anyone that plays the game: Happy zookeeping! ๐Ÿฆ๐Ÿ˜

You are viewing a single thread.
View all comments View context
1 point

You are correct. Its quiet a find but I can reproduce this. I suspect the issue lies in the piece of code that tries to make sure you donโ€™t get the same animal twice when you select a random animal. You can also follow the steps until there is only the Newt and then press the dice below itโ€™s name. Now there are no animals.

The random selector subtracts one from the total options and adds that one back if the new number is greater or equal to the precious number. So in case of only a single option it gets 0 at random, which equals the previous index and does +1, which doesnโ€™t exist.

There should be a failsafe that prevents this logic if there is only one animal in total ๐Ÿคทโ€โ™‚

permalink
report
parent
reply

Web Development

!webdev@programming.dev

Create post

Welcome to the web development community! This is a place to post, discuss, get help about, etc. anything related to web development

What is web development?

Web development is the process of creating websites or web applications

Rules/Guidelines

  • Follow the programming.dev site rules
  • Keep content related to web development
  • If what youโ€™re posting relates to one of the related communities, crosspost it into there to help them grow
  • If youre posting an article older than two years put the year it was made in brackets after the title

Related Communities

Wormhole

Some webdev blogs

Not sure what to post in here? Want some web development related things to read?

Heres a couple blogs that have web development related content

Credits

Icon base by Delapouite under CC BY 3.0 with modifications to add a gradient

Community stats

  • 4

    Monthly active users

  • 302

    Posts

  • 942

    Comments