Case Statement, Array, or another way  
Author Message
DTHMTLGOD





PostPosted: Visual Basic Express Edition, Case Statement, Array, or another way Top

I can do this via a Case Select Statement, but it would be a lot of lines of code.

Basically, here is my situation. Dice roll evaluation

NO X XX

2 3 6 2

3 x 3 4

4 9 1 3

5 4 xx 5

6 3 2 4

7 x 4 1

For example, I roll my first set of dice and it totals 3 or 7, I then roll again under the "X" column. If I roll a 5, then I would roll again on the "XX" column to determine the final result.

There are 16 mini-tables like above, so you can see that a Case Select statement would be thousands of lines of code.



Visual Studio Express Editions44  
 
 
SJWhiteley





PostPosted: Visual Basic Express Edition, Case Statement, Array, or another way Top

Create a 2 dimensional array with the required values in it (although it's a bit unclear what your table represents). Lookup in the table to see what you need to do with the die rolls.