To check the gems vertically, we will use a very similar method.
Method CheckGemsY:Int(column:Int, row:Int, gem:Int, mark:Bool=False) Local found:Int = 0 tileMap[column-1][row-1] = -1 'Check gems on the top If row > 1 Then For Local r:Int = (row-1) To 1 Step -1 If tileMap[column-1][r-1] <> gem Then Exit If mark Then tileMap[column-1][r-1] = 99 Else found += 1 Endif Next Endif 'Check gems on the bottom If row < rows Then For Local r:Int = (row+1) To rows If tileMap[column-1][r-1] <> gem Then Exit If mark Then tileMap[column-1][r-1] = 99 Else found += 1 Endif Next Endif If mark Then tileMap[column-1][row-1] = 99 Else tileMap[column-1][row-1] = gem Endif Return found End
52.15.129.253