VB Code:
'this array generated as per width of grid
Dim directions(5) As Integer = {LEFTUP, LEFTDOWN, DOWN, RIGHTDOWN, RIGHTUP, UP}
'this array deals with the spiralling effect
dim modifier(5) as integer = {-1, 0, 0, 0, 0, 0)
'this sub assumes that each tile object has a flag marking it as either lit up or not.
Sub FlagTiles(ByVal h As Integer)
Dim k, i, j, count As Integer
count = h + UP
highlight(count) 'always move 1 square up to start with and then continue spiral
For k = 0 To n 'how big your group of tiles will be
For i = 0 To 5 'the 6 sides of the hexagon group
For j = 1 To (k + modifier(i)) 'how many tiles on a particular side
count += directions(i) 'jump to next square
tile(count).litUp = True 'light it up!
Next j
Next i
Next k
End Sub