Andresleo47
Board Regular
- Joined
- Oct 29, 2008
- Messages
- 132
Hi, I'm working on a project where I have 2 sets of tiles, Upper Leve and Lower Level. 2-4 tiles will be randomly generated on each level, and several routes will be connected between two adjacent levels.
There are some restrictions:
There will be no lines connecting tiles on the same level the lines are straight and cannot cross and Every tile must have at least 1 line.
I am working this out with Random Numbers, suing the below modules:
Sub GeneratingARandomNumber()
However, I'm not finding a way to avoid repetitions and to make the code flow with the restrictions of the exercise. Can you give me a quick hand?
Thanks!!
There are some restrictions:
There will be no lines connecting tiles on the same level the lines are straight and cannot cross and Every tile must have at least 1 line.
I am working this out with Random Numbers, suing the below modules:
Sub GeneratingARandomNumber()
VBA Code:
Dim M As Integer
For M = 7 To 10
ActiveSheet.Cells(6, M) = "=INDEX(UNIQUE(RANDARRAY(1,4,0,4,TRUE)),SEQUENCE(10))"
Next M
End Sub
Sub GeneratingARandomNumber2()
Dim N As Integer
For N = 7 To 10
ActiveSheet.Cells(12, N) = "=INDEX(UNIQUE(RANDARRAY(1,4,0,4,TRUE)),SEQUENCE(10))"
Next N
End Sub
However, I'm not finding a way to avoid repetitions and to make the code flow with the restrictions of the exercise. Can you give me a quick hand?
Thanks!!