Skip to content

Instantly share code, notes, and snippets.

@Otto-Vector
Last active April 10, 2022 13:38
Show Gist options
  • Save Otto-Vector/9762bb1f469477add7612dce805e44c2 to your computer and use it in GitHub Desktop.
Save Otto-Vector/9762bb1f469477add7612dce805e44c2 to your computer and use it in GitHub Desktop.
VBA Fibonacci Split
Function FIBONACCI(number)
Summ = Summ Mod 9
If Summ = 0 Then
FIBONACCI = 9
Else
FIBONACCI = Summ
End If
End Function
Function FIBBOSPLIT(number)
Dim my_string As String
my_string = CStr(number)
Dim buff() As Integer
ReDim buff(Len(my_string) - 1)
For i = 1 To Len(my_string)
buff(i - 1) = CInt(Mid$(my_string, i, 1))
Next
For i = 1 To Len(my_string) - 1
For j = 1 To (UBound(buff) - LBound(buff))
buff(j - 1) = FIBONACCI(buff(j - 1) + buff(j))
Next
Next
FIBBOSPLIT = buff(0)
End Function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment