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.

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!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.