Eine aufbereitete Darstellung der Quelle

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


Quelle  Schachbrett.cob   Sprache: Cobol

 

       identification division.
       program-id. schach.
      * aus Univalg - Beispiel zu Relationen
      * die eine Äquivalenz modulo ... definieren
      * Februar 2011
       author. JD.
       date-written. 6.2.2011.
       date-compiled.
       data division.
       working-storage section.
         77 white value 1.
         77 black value 2.
         77 sumrc pic 9(4).
       linkage section.
         01 chessfield.
           05 r pic 9(4).
           05 c pic 9(4).
         77 color pic 9(4).
         77 neighbours pic 9(4).
         77 rplusc pic 9(4).
         77 keyofrc pic 9(4)V9(4).
       procedure division using chessfield
                                color
                                rplusc
                                keyofrc.
         perform fieldcolor.
         perform numberneighbours.
         compute rplusc=r+c.
         compute keyofrc=r-1/c.
          stop run.
      *
       fieldcolor.
         add r c giving sumrc.
         if function mod(sumrc,2)=0 then
           move white to color
         else
           move black to color
       numberneighbours.
         if (r=1 or r=8) and (c=1 or c=8) then
           move 3 to neighbours
         else if r=1 or r=8 or c=1 or c=8 then 
           move 5 to neighbours
         else    
           move 8 to neighbours
        end-program schach.

Messung
CHZG
8710010095

¤ 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,835
#Domains=906,747