so ich habs mal in viusal Basic umgesetzt und scheint alles zu worken^^
Public Class Form1
Private Function Quersumme(ByVal vZahl As Object) As Long
Dim sZahl As String
Dim nLen As Long
Dim i As Long
Dim nSum As Long
sZahl = CStr(vZahl)
nLen = Len(sZahl)
For i = 1 To nLen
If IsNumeric(Mid$(sZahl, i, 1)) Then
nSum = nSum Val(Mid$(sZahl, i, 1))
End If
Next i
' Rückgabewert: Summe
Quersumme = nSum
End Function
Function gener(ByVal inhalt As String)
inhalt = Replace(inhalt, " ", "0")
inhalt = Replace(inhalt, "a", "2")
inhalt = Replace(inhalt, "b", "3")
inhalt = Replace(inhalt, "c", "4")
inhalt = Replace(inhalt, "d", "5")
inhalt = Replace(inhalt, "e", "6")
inhalt = Replace(inhalt, "f", "7")
inhalt = Replace(inhalt, "g", "8")
inhalt = Replace(inhalt, "h", "9")
inhalt = Replace(inhalt, "i", "1")
inhalt = Replace(inhalt, "j", "2")
inhalt = Replace(inhalt, "k", "3")
inhalt = Replace(inhalt, "l", "4")
inhalt = Replace(inhalt, "m", "5")
inhalt = Replace(inhalt, "n", "6")
inhalt = Replace(inhalt, "o", "7")
inhalt = Replace(inhalt, "p", "8")
inhalt = Replace(inhalt, "q", "9")
inhalt = Replace(inhalt, "r", "5")
inhalt = Replace(inhalt, "s", "6")
inhalt = Replace(inhalt, "t", "7")
inhalt = Replace(inhalt, "u", "8")
inhalt = Replace(inhalt, "v", "9")
inhalt = Replace(inhalt, "w", "1")
inhalt = Replace(inhalt, "x", "2")
inhalt = Replace(inhalt, "y", "3")
inhalt = Replace(inhalt, "z", "4")
inhalt = Replace(inhalt, "A", "2")
inhalt = Replace(inhalt, "B", "3")
inhalt = Replace(inhalt, "C", "4")
inhalt = Replace(inhalt, "D", "5")
inhalt = Replace(inhalt, "E", "6")
inhalt = Replace(inhalt, "F", "7")
inhalt = Replace(inhalt, "G", "8")
inhalt = Replace(inhalt, "H", "9")
inhalt = Replace(inhalt, "I", "1")
inhalt = Replace(inhalt, "J", "2")
inhalt = Replace(inhalt, "K", "3")
inhalt = Replace(inhalt, "L", "4")
inhalt = Replace(inhalt, "M", "5")
inhalt = Replace(inhalt, "N", "6")
inhalt = Replace(inhalt, "O", "7")
inhalt = Replace(inhalt, "P", "8")
inhalt = Replace(inhalt, "Q", "9")
inhalt = Replace(inhalt, "R", "1")
inhalt = Replace(inhalt, "S", "2")
inhalt = Replace(inhalt, "T", "3")
inhalt = Replace(inhalt, "U", "4")
inhalt = Replace(inhalt, "V", "5")
inhalt = Replace(inhalt, "W", "6")
inhalt = Replace(inhalt, "X", "7")
inhalt = Replace(inhalt, "Y", "8")
inhalt = Replace(inhalt, "Z", "9")
inhalt = Quersumme(inhalt)
Return inhalt
End Function
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim Name1 As String = TextBox1.Text
Dim Name2 As String = TextBox2.Text
Dim zahl As Integer = 0
Dim zahl2 As Integer
Name1 = gener(Name1)
Name1 = CInt(Name1)
Name2 = gener(Name2)
Name2 = CInt(Name2)
zahl = Name1 Name2
zahl = zahl 6
Rnd(-1)
Randomize(zahl)
zahl2 = Int((100 - 1 1) * Rnd()) 1
TextBox3.Visible = True
TextBox3.Text = CStr(zahl2) "%"
End Sub
End Class
http://uploaded.to/?id=len6qs <-- Compiled version: 73KB groß //.Net Framework benötigt