Jump to content

"decrypting" letters - help

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
7 replies to this topic

#1
endrezr

endrezr

    Newbie

  • Members
  • Pip
  • 5 posts
HI

I need help to write a program that tells wich letter is used instead of wich number, that is:

donald
+gerald
--------
robert
the idea is that the program find's out what number is a, b, etc..

or at least links to some useful pages

thanks

#2
Lop

Lop

    Speaks fluent binary

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,172 posts
You are looking for the ascii conversion of the letters? Use the ASC() function to convert characters into the ascii code.

#3
endrezr

endrezr

    Newbie

  • Members
  • Pip
  • 5 posts
In details, I was thinking of something like this:
in visual basic:
for i1=1 to 9 do
A=i1
for i2=1 to 9 do
B=i2
for i3=1 to 9 do
B=i3
(etc. for all the letters that are important for this case)

if (100000*D+10000*O+1000*N+100*A+10*L+D)+
+(100000*G+10000*E+1000*R+100*A+10*L+D)=
=(100000*RG+10000*O+1000*B+100*E+10*R+T) then
the program displays the found values for each letter

#4
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
What you just put would be the basic logic.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#5
endrezr

endrezr

    Newbie

  • Members
  • Pip
  • 5 posts
Private Sub cmdStart_Click()
Dim D As Double
Dim O As Double
Dim N As Double
Dim A As Double
Dim L As Double
Dim G As Double
Dim E As Double
Dim R As Double
Dim B As Double
Dim T As Double
'Dim i1 As Double

'Dim i2, i3, i4, i5, i6, i7, i8, i9, i10 As Double



For D = 1 To 9
Next D
For O = 1 To 9
Next O
For N = 1 To 9
Next N
For A = 1 To 9
Next A
For L = 1 To 9
'L = i5
Next L
For G = 1 To 9
'G = i6
Next G
For E = 1 To 9
'E = i7
Next E
For R = 1 To 9
'R = i8
Next R
For B = 1 To 9
'B = i9
Next B
For T = 1 To 9
'T = i10
Next T
If (100000 * D + 10000 * O + 1000 * N + 100 * A + 10 * L + D) + (100000 * G + 10000 * E + 1000 * R + 100 * A + 10 * L + D) = (100000 * R + 10000 * O + 1000 * B + 100 * E + 10 * R + T) Then
'MsgBox (D & "is D")
txtD.Text = D
End If

'MsgBox ("A=" & i1)

End Sub


I did this, but at the end the txtD.Text stays empty, why????

#6
endrezr

endrezr

    Newbie

  • Members
  • Pip
  • 5 posts
Here is the new version:

Private Sub cmdStart_Click()
Dim D As Double
Dim O As Double
Dim N As Double
Dim A As Double
Dim L As Double
Dim G As Double
Dim E As Double
Dim R As Double
Dim B As Double
Dim T As Double
'Dim i1 As Double

'Dim i2, i3, i4, i5, i6, i7, i8, i9, i10 As Double



For D = 1 To 9
For O = 1 To 9
For N = 1 To 9
For A = 1 To 9
For L = 1 To 9
For G = 1 To 9
For E = 1 To 9
For R = 1 To 9
For B = 1 To 9
For T = 1 To 9
If (100000 * D + 10000 * O + 1000 * N + 100 * A + 10 * L + D) + (100000 * G + 10000 * E + 1000 * R + 100 * A + 10 * L + D) = (100000 * R + 10000 * O + 1000 * B + 100 * E + 10 * R + T) Then
'MsgBox (D & "is D")
txtD.Text = D
End If
Next T
Next B
Next R
Next E
Next G
Next L
Next A
Next N
Next O
Next D



MsgBox ("A=" & A) 'for example to diplay the num value of A

End Sub

#7
Lop

Lop

    Speaks fluent binary

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,172 posts
And the new version works?

#8
endrezr

endrezr

    Newbie

  • Members
  • Pip
  • 5 posts
not realy, because for example d cannot be equal to r.
so I made this changes, but it still doesn't work all the way:
Private Sub cmdStart_Click()
Dim D As Double
Dim O As Double
Dim N As Double
Dim A As Double
Dim L As Double
Dim G As Double
Dim E As Double
Dim R As Double
Dim B As Double
Dim T As Double


For D = 1 To 9
For O = 1 To 9
For N = 1 To 9
For A = 1 To 9
For L = 1 To 9
For G = 1 To 9
For E = 1 To 9
For R = 1 To 9
For B = 1 To 9
For T = 1 To 9
If D <> O And D <> N And D <> A And D <> L And D <> G And D <> E And D <> R And D <> B And D <> T Then
If O <> N And O <> A And O <> L And O <> G And O <> E And O <> R And O <> B And O <> T Then
If N <> A And N <> L And N <> G And N <> E And N <> R And N <> B And N <> T Then
If A <> L And A <> G And A <> E And A <> R And A <> B And A <> T Then
If L <> G And L <> E And L <> R And L <> B And L <> T Then
If G <> E And G <> R And G <> B And G <> T Then
If E <> R And E <> B And E <> T Then
If R <> B And R <> T Then
' Beep ( I've put this here just to see if the program executes tis far)
If B <> T Then

If (100000 * D + 10000 * O + 1000 * N + 100 * A + 10 * L + D) + (100000 * G + 10000 * E + 1000 * R + 100 * A + 10 * L + D) = (100000 * R + 10000 * O + 1000 * B + 100 * E + 10 * R + T) Then MsgBox (D & O & N & A & L & G & E & R & B & T) 'txtD.Text = D 'MsgBox (D)
'txtD.Text = D
'Else

End If
End If
End If
End If
End If
End If
End If
End If
End If
Next T
Next B
Next R
Next E
Next G
Next L
Next A
Next N
Next O
Next D
End Sub


at the end I dont get the messagebox, any ideas?