Autor Beitrag
NeoXan
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 81

WinXP Sp1 Home
D7 Prof
BeitragVerfasst: Sa 05.07.03 14:43 
Zitat:
1 [..] 1 [..] 1 [..] 1 = 4


Nun sollen halt alle Möglichkeiten gesucht werden, bis man die richtigen Vorzeichen gefunden hat...
Also checkstr überprüft nur ob, wenn man die Vorzeichen einsetzt, es aufgeht...
Nur bekomme ich das nicht so hin, dass alle Möglichkeiten ausprobiert werden...
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
procedure TfrmMain.check;
var signs    : array[1..3] of string;  //the signs; allowed ([+],[-])
    a,b,c,d  : integer;                //for the for-to-do
begin
// Var
 signs[1] := '-';
 signs[2] := '+';
 signs[3] := '+';

  while checkstr(signs[1],signs[2],signs[3])=false do
   begin
    for a:=1 to 2 do
     begin
      for b:=1 to 2 do
       begin
        for c:=1 to 2 do
         begin
          signs[1]:= '+';
         end;
       end;
     end;
   end;
  showmessage('found');
end;
Phantom1
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 390



BeitragVerfasst: Sa 05.07.03 15:51 
ich glaube du meinst es so hier:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
procedure TfrmMain.check; 
Const
  signs: String[2]='+-';
Var
  a,b,c: integer;
begin
  for a:=1 to 2 do
    for b:=1 to 2 do
      for c:=1 to 2 do
        If checkstr(signs[a],signs[b],signs[c]) Then
          showmessage('found');
end;
NeoXan Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 81

WinXP Sp1 Home
D7 Prof
BeitragVerfasst: Sa 05.07.03 17:48 
hey, danke, hat gefunzt :P...jetzt fehlt mir nur noch wie man Items in die ListView einträgt :shock:

2 Spalten...

ausblenden Delphi-Quelltext
1:
2:
  lvWays.AddItem(checker,nil);
  lvWays.Items.AddItem(nil,1).SubItems.Add('True');

hmm...also er soll halt die gerade versuchte Rechnung (checker) eintragen und dann in der gleichen Zeile, aber in die 2. Spalte halt true...
irgendwie haperts da bei mir...ich krieg zwar beides eingetragen, nur nicht in die gleiche zeile...
Phantom1
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 390



BeitragVerfasst: Sa 05.07.03 18:02 
am besten du erstellst ein neues topic im VCL forum, du kannst auch mal die suchfunktion nutzten, das thema gabs glaub ich schon mehrmals