identificationdivision. program-id. schach. * aus Univalg - Beispiel zu Relationen * die eine Äquivalenz modulo ... definieren * Februar 2011 author. JD. date-written. 6.2.2011. date-compiled. datadivision. working-storagesection.
77 white value 1.
77 black value 2.
77 sumrc pic 9(4). linkagesection.
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). proceduredivisionusing chessfield
color
rplusc
keyofrc. perform fieldcolor. perform numberneighbours. compute rplusc=r+c. compute keyofrc=r-1/c. stoprun. *
fieldcolor. add r c giving sumrc. iffunction 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 elseif r=1 or r=8 or c=1 or c=8 then move 5 to neighbours else move 8 to neighbours end-program schach.
¤ Dauer der Verarbeitung: 0.18 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.