Eine aufbereitete Darstellung der Quelle

 
     
 
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung


Quelle  turingmaschine-teubner2-p6.cob   Sprache: Cobol

 

       identification division.
       program-id. turing.
       author. "JD".
       date-written. 25.10.2004.
       date-compiled.
       data division.
       working-storage section.
        77 card       pic 9(4)  value 5.
        77 leftband   pic 9(16) value 0.
        77 state      pic 9(16).
          88 startstate        value 0.
        77 endstate   pic 9(16).
          88                   value 3.
        77 head       pic 9(1).
       linkage section.
        77 rightband pic 9(16).
       procedure division using reference rightband.
      **********************************************
      *simuliert eine Turing Maschine
      *   Bandalphabet   als Integer mit Kardinalität card
      *   Eingbealphabet als Integer mit Kardinalität card
      *   rechtes Band   als Integer mit Basis card(Alphabet)
      *   linkes  Band   als Integer mit Basis card(Alphabet)
      *   Zustand        als Integer
      **********************************************
         display "start"
      * check rightband for input alphabet obmitted
          set startstate to true
         perform until (state=endstate)
          compute head=function mod(rightband,card)
           evaluate true
           when state=0
             if      head=0 then move 1 to state perform xright
             end-if
           when state=1
             if      head=0 then move 1 to state perform 0right
             else if head=1 then move 2 to state perform yleft
             else if head=2 then continue
             else if head=3 then continue
             else if head=4 then move 1 to state perform yright
           when state=2
             if      head=0 then move 4 to state perform 0left
             else if head=1 then continue
             else if head=2 then continue
             else if head=3 then move 3 to state perform xright
             else if head=4 then move 2 to state perform yleft
           when state=3
             if      head=0 then continue
             else if head=1 then continue
             else if head=2 then move 5 to state perform yright
             else if head=3 then continue
             else if head=4 then move 3 to state perform yright
           when state=4
             if      head=0 then move 4 to state perform 0left
             else if head=1 then continue
             else if head=2 then continue
             else if head=3 then move 0 to state perform xright
             else if head=4 then continue
           when state=endstate
             display "ende, Leftband="leftband" Rightband="rightband
           end-evaluate
         end-perform.
         goback.
        0left.
         compute leftband=leftband/card   compute rightband=rightband*card
        1left.
         compute leftband=leftband/card   compute rightband=rightband*card+1
        bleft.
         compute leftband=leftband/card   compute rightband=rightband*card+2
        xleft. 
         compute leftband=leftband/card   compute rightband=rightband*card+3
        yleft.
         compute leftband=leftband/card   compute rightband=rightband*card+4
        0right.
         compute leftband=leftband*card   compute rightband=rightband/card
        1right.
         compute leftband=leftband*card   compute rightband=rightband/card+1
        bright.
         compute leftband=leftband*card   compute rightband=rightband/card+2
        xright.
         compute leftband=leftband*card   compute rightband=rightband/card+3
        yright.
         compute leftband=leftband*card   compute rightband=rightband/card+4
        end-program turing.

Messung
CHZG
8810010096

¤ Dauer der Verarbeitung: 0.3 Sekunden  (vorverarbeitet am  2026-11-25) ¤

*© Formatika GbR, Deutschland







                                                                                                                                                                                                                                                                                                                                                                                                     

 

Neuigkeiten

Aktuelles
Motto des Tages

Open Source Software


Gedichte
Musik
Bilder

Jenseits des Üblichen

Besucherstatistik

Besucherstatistik

Statistik
#Sources=1,188,836
#Domains=906,752