|
||||||
| Visual Basic Programming Discussion forum for Visual Basic, an event driven programming language and associated development environment from Microsoft for its COM programming model. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
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 Last edited by endrezr; 10-18-2007 at 03:26 PM. |
| Sponsored Links |
|
|
|
|||
|
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 |
|
|||||
|
What you just put would be the basic logic.
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum Programming is a branch of mathematics. |
|
|||
|
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???? |
| Sponsored Links |
|
|
|
|||
|
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 |
|
|||
|
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? |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| These are taken from real resumes and cover letters and were printed in the 7/27/97 | priorityone | The Lounge | 7 | 01-29-2007 12:00 PM |
| WingedPanther | ........ | 2753.6 |
| Xav | ........ | 2704 |
| Brandon W | ........ | 1702.32 |
| John | ........ | 1207.73 |
| marwex89 | ........ | 1175.24 |
| morefood2001 | ........ | 966.05 |
| dcs | ........ | 655.75 |
| Steve.L | ........ | 475.59 |
| orjan | ........ | 418.58 |
| Aereshaa | ........ | 383.54 |