|
DataMuseum.dkPresents historical artifacts from the history of: RC4000/8000/9000 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about RC4000/8000/9000 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 4608 (0x1200) Types: TextFile Names: »swg«
└─⟦00964e8f7⟧ Bits:30007478 RC8000 Dump tape fra HCØ. └─⟦b2ec5d50f⟧ └─⟦this⟧ »swg«
begin comment udskrivning af et spil, træk for træk. Der indtastes 1. et heltal for ønsket antal eksemplarer af hvert spil, 2. et heltal for ønsket margin om de besatte felter, og 3. efter udskriv- ningen 0, hvis spillene skal slettes ellers <> 0; procedure colnameline; begin integer col,char; write(out,<:<10>:>); for mno:= rowstartmove step 1 until moveno-1 do begin write(out,<: :>); for col:= collow step 1 until colhigh do begin char:= if col>8 then col+65 else col+64; write(out,false add char,1) end end end; integer ex,x,gc,gcount,lines,move,lastmove,winner,b,margin, row,rowlow,rowhigh,rowbno,rowstartmove, col,collow,colhigh,i,maxdepth, newrl,newrh,newcl,newch,mover; integer field if1; boolean field bf,moveno,mno; real gamestart,clock; real field rf; boolean array board(1:11,1:19,1:19); zone gamerec(128,1,stderror); open(gamerec,4,<:gamerecords:>,0); read(in,ex); read(in,margin); inrec6(gamerec,2); if1:= 2; gcount:= gamerec.if1; if gcount < 330 then for gc:= 1 step 1 until gcount do begin inrec6(gamerec,222); for x:= 1 step 1 until ex do begin lines:= 66; for rowbno:= 1 step 1 until 11 do for row:= 1 step 1 until 19 do for col:= 1 step 1 until 19 do board(rowbno,row,col):= false add 46; rowstartmove:= 1; rowbno:= 0; rowlow:= collow:= 19; rowhigh:= colhigh:= 1; bf:= 151; lastmove:= gamerec.bf extract 12; bf:= 152; winner:= gamerec.bf extract 12; rf:= 156; gamestart:= gamerec.rf; for moveno:= 1 step 1 until lastmove+1 do begin rowbno:= rowbno+1; move:= gamerec.moveno extract 12; row:= move//2 mod 21; col:= move//2//21; if col<1 or col>19 then col:= 19; newrl:= if row-margin<rowlow then row-margin else rowlow; if newrl<1 then newrl:= 1; newrh:= if row+margin>rowhigh then row+margin else rowhigh; if newrh>19 then newrh:= 19; newcl:= if col-margin<collow then col-margin else collow; if newcl<1 then newcl:= 1; newch:= if col+margin>colhigh then col+margin else colhigh; if newch>19 then newch:= 19; if (newch-newcl+3)*rowbno >70 or rowbno > 10 or moveno > lastmove then begin integer move,row,col,char; if lines+newrh-newrl+1+6 > 63 then begin lines:= 0; write(out,<:<12>:>,<<dd dd dd>, systime(2,gamestart,clock), <: :>,clock); for mover:= 1,2 do begin i:= 3*mover+37; write(out,case mover of (<:<10>X :>,<:<10>O :>), string gamerec(increase(i))); bf:= 168+18*mover; maxdepth:= gamerec.bf extract 12; if maxdepth>0 then begin write(out,<<ddd>,maxdepth shift (-4),maxdepth extract 4,<:::>); for i:= 1 step 1 until (maxdepth extract 4)+1 do begin bf:= 168+18*mover+i; write(out,<<dd>,gamerec.bf extract 12); end; for i:= 4,5,3,2 do begin bf:= 180+i+18*mover; write(out,<:;:>,<<ddd>,gamerec.bf extract 12) end end end mover end new page; write(out,<:<10><10><10>:>); for mno:= rowstartmove step 1 until moveno-1 do begin move:= gamerec.mno extract 12; row:= move//2 mod 21; col:= move//2//21; char:= if col>8 then col+65 else col+64; write(out,<<dd>,mno,<: :>); write(out,false add char,1,<<dd>,row, false add 32,colhigh-collow-3) end; write(out,<:<10>:>); colnameline; for row:= rowhigh step -1 until rowlow do begin write(out,<:<10>:>,<<dd>,row); for mno:= 1 step 1 until rowbno-1 do begin for col:= collow step 1 until colhigh do write(out,board(mno,row,col),1); write(out,<<dd>,row) end end; colnameline; for rowbno:= 1 step 1 until 10 do for row:= 1 step 1 until 19 do for col:= 1 step 1 until 19 do board(rowbno,row,col):= board(11,row,col); rowbno:= 1; rowstartmove:= moveno; lines:= lines+newrh-newrl+1+6; end board row; if moveno <= lastmove then begin board(rowbno,row,col):= false add (79+9*(moveno mod 2)); for i:= rowbno+1 step 1 until 11 do board(i,row,col):= false add (111+9*(moveno mod 2)); end; rowlow:= newrl; rowhigh:= newrh; collow:= newcl; colhigh:= newch; end moveno; write(out,<:<10><10>:>,case winner+1 of (<:remis efter 150 træk:>, <:X vinder:>, <:O vinder:>, <:spillet erklæret remis:>, <:X erklæret vinder:>, <:O erklæret vinder:>)); end x; end gc; read(in,i); if i=0 then begin setposition(gamerec,0,0); swoprec6(gamerec,2); if1:= 2; gamerec.if1:= 0 end; close(gamerec,true) end program ▶EOF◀