Need to calculate a very specific number (Don’t know what it would be called!)

Ok so I’m making a short little game, and need to calculate a value. Basically you have x amount of guesses to guess the number the computer chooses. The user gets to define the bounds however, so I would like to make the ‘lives’ so to speak semi-equal and balanced whether you pick the bounds as 0-100, or 0-10000.

I have no clue how to calculate this, but it doesn’t have to be exact, just a rough estimate because this is just a short little project for me and my friend and isn’t going anywhere. If I need to create seperate cases too, I am able to do that, as this is code. For example,

if(bounds > 1000)     -run this calculation if(bounds < 1000)     -run this other calculation 

I tried doing some simple stuff, but like if I have 17, 18 guesses to guess a number between 0-1000, I have 1 guess to guess a number between 0 – 100 thanks guys!