I'm back after being gone for a while. Thus I haven't played with VB in some time. Thus my brain strength has gone out with it. I'm still working on my game and trying to make the system choose a number between 10 to 21 then put that into a label.caption. In so doing, I've tried certain formulas but it just isn't working. Here is something like I thought it would look like:

aroll.Caption = Str(Int(Rnd * 21 - 10))

Obviously the formula is wrong, but I can't seem to figure out where.

Thanks in advance for any help.

8 Years
Discussion Span
Last Post by venomocity

I figured it out. I knew I had it wrote down somewhere! And thus here is the answer.

aroll.Caption = Int((21 - 10) * Rnd + 10)

Thanks anyway!

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.