These are functions to determine to which betting location does a number belong to:
- getColor() (link:://rouletteforum.cc/index.php?topic=7680.msg69754#msg69754)
- getLowHigh() (link:://rouletteforum.cc/index.php?topic=7680.msg69755#msg69755)
- getEvenOdd() (link:://rouletteforum.cc/index.php?topic=7680.msg69756#msg69756)
- getDozen() (link:://rouletteforum.cc/index.php?topic=7680.msg69757#msg69757)
- getColumn() (link:://rouletteforum.cc/index.php?topic=7680.msg69758#msg69758)
- getLine() (link:://rouletteforum.cc/index.php?topic=7680.msg69759#msg69759)
- getStreet() (link:://rouletteforum.cc/index.php?topic=7680.msg69760#msg69760)
Do keep them handy.
You are going to use these a lot in your roulette coding!
getColor()
' Determines the color of a number
' Returns "BLACK", "RED" or "GREEN"
Private Function getColor(ByVal num As Byte) As String
Select Case num
Case 1, 3, 5, 7, 9, 12, 14, 16, 18, 19, 21, 23, 25, 27, 30, 32, 34, 36
' Red number
Return "RED"
Case 2, 4, 6, 8, 10, 11, 13, 15, 17, 20, 22, 24, 26, 28, 29, 31, 33, 35
' Black number
Return "BLACK"
Case Else
' Anything else = green
Return "GREEN"
End Select
End Function
getLowHigh()
' Determines if a number belongs to the Low or High location
' Returns "LOW", "HIGH" or "GREEN"
Private Function getLowHigh(ByVal num As Byte) As String
Select Case num
Case 1 To 18
' Low number
Return "LOW"
Case 19 To 36
' High number
Return "HIGH"
Case Else
' Green
Return "GREEN"
End Select
End Function
getEvenOdd()
' Determines if a number belongs to the Even or Odd location
' Returns "EVEN", "ODD" or "GREEN"
Private Function getEvenOdd(ByVal num As Byte) As String
Select Case num
Case 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36
' Even number
Return "EVEN"
Case 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35
' Odd number
Return "ODD"
Case Else
' Anything else = green
Return "GREEN"
End Select
End Function
getDozen()
' Determines the dozen that a number belongs to
' Returns 0, 1, 2, 3.
Private Function getDozen(ByVal num As Byte) As Byte
Select Case num
Case 1 To 12
' First dozen
Return 1
Case 13 To 24
' Second dozen
Return 2
Case 25 To 36
' Third dozen
Return 3
Case Else
' No dozen
Return 0
End Select
End Function
getColumn()
' Determines the column that a number belongs to
' Returns 0, 1, 2, 3.
Private Function getColumn(ByVal num As Byte) As Byte
Select Case num
Case 1, 4, 7, 10, 13, 16, 19, 22, 25, 28, 31, 34
' First column
Return 1
Case 2, 5, 8, 11, 14, 17, 20, 23, 26, 29, 32, 35
' Second column
Return 2
Case 3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 33, 36
' Third column
Return 3
Case Else
' No column
Return 0
End Select
End Function
getLine()
' Determines the line (double-street) a number belongs to
' Returns 0, 1, 2, 3, 4, 5, 6
Private Function getLine(ByVal num As Byte) As Byte
Select Case num
Case 1 To 6
' 1st line
Return 1
Case 7 To 12
' 2nd line
Return 2
Case 13 To 15
' 3rd line
Return 3
Case 19 To 24
' 4th line
Return 4
Case 25 To 30
' 5th line
Return 5
Case 31 To 36
' 6th line
Return 6
Case Else
' No line
Return 0
End Select
End Function
getStreet()
' Determines the Street a number belongs to
' Returns 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
Private Function getStreet(ByVal num As Byte) As Byte
Select Case num
Case 1 To 3
' 1st street
Return 1
Case 4 To 6
' 2nd street
Return 2
Case 7 To 9
' 3rd street
Return 3
Case 10 To 12
' 4th street
Return 4
Case 13 To 15
' 5th street
Return 5
Case 16 To 18
' 6th street
Return 6
Case 19 To 21
' 7th street
Return 7
Case 22 To 24
' 8th street
Return 8
Case 25 To 27
' 9th street
Return 9
Case 28 To 30
' 10th street
Return 10
Case 31 To 33
' 11th street
Return 11
Case 34 To 36
' 12th street
Return 11
Case Else
' No street
Return 0
End Select
End Function