AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Programmierung Türme von Hanoi

Ein Thema von nairolf92 · begonnen am 9. Feb 2010 · letzter Beitrag vom 18. Feb 2010
Antwort Antwort
Benutzerbild von Sir Rufo
Sir Rufo

Registriert seit: 5. Jan 2005
Ort: Stadthagen
9.454 Beiträge
 
Delphi 10 Seattle Enterprise
 
#1

Re: Programmierung Türme von Hanoi

  Alt 15. Feb 2010, 18:30
ich glaube nicht, dass deine funktion so compiliert wird.
da fehlt jede Menge "end;"
Würde man auch sofort sehen, wenn man sich etwas an den Style-Guide von Delphi halten würde:
Delphi-Quellcode:
procedure bewegen( start, ziel : integer );
  var
    safe, Auswahl1, Auswahl2, Auswahl3, a, s1a, s2a, s3a : integer;
  begin
    s1a := strtoint( edit5.Text );
    s2a := 0;
    s3a := 0;
    Auswahl1 := s1a;
    Auswahl2 := s2a;
    Auswahl3 := s3a;

    if ( start = 1 ) and ( ziel = 2 ) then
      safe := 12;
    if safe = 12 then
      begin
        image( Auswahl1 ).top := ( 408 - 32 * s2a );
        image( Auswahl1 ).left := image( Auswahl1 ).left + 184;
        s1a := s1a - 1;
        s2a := s2a + 1;

      end;
    if ( start = 1 ) and ( ziel = 3 ) then
      safe := 13;
    if safe = 13 then
      begin
        image( Auswahl1 ).top := ( 408 - 32 * s3a );
        image( Auswahl1 ).left := image( Auswahl1 ).left + 368;
        s1a := s1a - 1;
        s3a := s3a + 1;

        if ( start = 2 ) and ( ziel = 3 ) then
          safe := 23;
        if safe = 23 then
          begin
            image( Auswahl2 ).top := ( 408 - 32 * s3a );
            image( Auswahl2 ).left := image( Auswahl2 ).left + 184;
            s2a := s2a - 1;
            s3a := s3a + 1;

            if ( start = 2 ) and ( ziel = 1 ) then
              safe := 21;
            if safe = 21 then
              begin
                image( Auswahl2 ).top := ( 408 - 32 * s1a );
                image( Auswahl2 ).left := image( Auswahl2 ).left - 184;
                s2a := s1a - 1;
                s1a := s1a + 1;

                if ( start = 3 ) and ( ziel = 1 ) then
                  safe := 31;
                if safe = 31 then
                  begin
                    image( Auswahl ).top := ( 408 - 32 * s1a );
                    image( Auswahl ).left := image( Auswahl ).left - 368;
                    s3a := s3a - 1;
                    s1a := s1a + 1;

                    if ( start = 3 ) and ( ziel = 2 ) then
                      safe := 32;
                    if safe = 32 then
                      begin
                        image( Auswah )l.top := ( 408 - 32 * s1a );
                        image( Auswahl ).left := image( Auswahl ).left - 184;
                        s3a := s3a - 1;
                        s2a := s2a + 1;
                      end;
Kaum macht man's richtig - schon funktioniert's
Zertifikat: Sir Rufo (Fingerprint: ‎ea 0a 4c 14 0d b6 3a a4 c1 c5 b9 dc 90 9d f0 e9 de 13 da 60)
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 19:33 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz