Jump to content
  • 0
Sign in to follow this  
Shadow72

RESOLVED Random tile not working properly

Question

If you use the random tile to generate a random number between 2 values it will never be the max. For instance if you use random to create a number between 1 and 3 it will only generate random numbers between 1 and 2.

 

Current workaround is adding + 1 to your max value.

Share this post


Link to post
Share on other sites

4 replies to this bug / suggestion

Recommended Posts

  • 0
2 minutes ago, Cernu said:

The wiki describes this.

Hmm, I just saw that. It's still kinda confusing why they wouldn't have the random number include the max.

Share this post


Link to post
Share on other sites
  • 0

I never had problems with the maximum value? but it may be the one that appears the least, the random number can have a strange structure, if it is used at the beginning of the game the value that appears will depend on the time it takes to work, also the central value of the two established will be the one that appears the most. For example, if you put between 0 and 10, 5 will be the value that will appear more easily, to obtain a more random probability it is better to combine 2 or 3 of them or leave higher margins to increase the possibilities

 

  • Thanks 1

Share this post


Link to post
Share on other sites
  • 0
2 hours ago, Shadow72 said:

Hmm, I just saw that. It's still kinda confusing why they wouldn't have the random number include the max.

yes definitely, although this is quite a common occurence in coding. Furthermore, the random 0-1 tile doesn't have this limitation.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×