|
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: 3840 (0xf00) Types: TextFile Names: »sinitval«
└─⟦667bb35d6⟧ Bits:30007480 RC8000 Dump tape fra HCØ. └─⟦4334b4c0b⟧ └─⟦this⟧ »sinitval«
begin comment program initval. Programmet initialiserer tabellerne totval og envval. Den interne spillers navn og vægtblok indlæses; integer array totval(0:881), env(176:3351), stone(-6:6), weight(-4:4), free(1:2,-1:1), envval(-2:3280); real array playername(1:3); integer dir,fieldd,f,fiveroffset,player,stones,i, limit,j,k,l,m,n,q,fval,threat; boolean field ij,pq,rs,w; disk(env,351,6702,<:env:>,0,0); comment indlæs spillernavn; readstring(in,playername,1); comment indlæs vægtblokken; for ij:= -1 step -1 until -5 do begin read(in,i); envval.ij:= false add i; weight(ij+1):= weight(-ij-1):= i end; stone(0):= 1; stone(-6):= stone(-5):= stone(5):= stone(6):= 0; for w:= 0 step 1 until 6560 do begin i:= w; comment find hvilke sten, w består af; for l:= 1 step 1 until 8 do begin j:= case l of (2187,729,243,81,27,9,3,1); k:= case l of (-4,4,-3,3,-2,2,-1,1); stone(k):= i//j; i:= i-j*stone(k) end l; comment find for hver spiller nærmeste modstander-sten på hver side af midten; for player:= 1,2 do for limit:= -1,1 do begin for q:= 0,q+1 while q<5 and stone(limit*q) <> 3-player do ; free(player,limit):= limit*q end player,limit; fval:= threat:= 0; for fiveroffset:= free(1,-1)+1 step 1 until free(1,1)-5 do if stone(fiveroffset-1)<>1 and stone(fiveroffset+5)<>1 then begin f:= fiveroffset; stones:= 0; for fieldd:= f step 1 until f+4 do if stone(fieldd) = 1 then begin stones:= stones+1; fval:= fval+weight(fieldd) end; case stones of begin comment 1; ; comment 2; ; begin comment 3; if threat < 1 and (-,(stone(f-2)=1 and stone(f-1)=0)) and (-,(stone(f+5)=0 and stone(f+6)=1)) and (-,(stone(f-1)=2 and stone(f+5)=2)) and (-,(stone(f)=1 and stone(f+4)=1)) and (-,(stone(f-1)=2 and stone(f)=1)) and (-,(stone(f+5)=2 and stone(f+4)=1)) then threat:=1 end 3; begin comment 4; if (stone(f-1)=0 and stone(f+4)=0 and stone(f-2)<>1 and stone(f+5)<>1) or (stone(f)=0 and stone(f+5)=0 and stone(f-1)<>1 and stone(f+6)<>1) then threat:= 5 else if threat < 4 then threat:= threat+3 end 4; begin comment 5; threat:= 11 end 5; end stones; end fiveroffset; for fiveroffset:= free(2,-1)+1 step 1 until free(2,1)-5 do if stone(fiveroffset-1)<>2 and stone(fiveroffset+5)<>2 then for fieldd:= fiveroffset step 1 until fiveroffset+4 do if stone(fieldd)=2 then for i:= fieldd step 1 until fiveroffset+4 do if stone(i)=2 then fval:= fval+weight(i-fieldd); endw: if threat=1 or threat=3 then fval:= 15; envval.w:= false add fval add (threat shift 7) end w; for i:= 0 step 1 until 881 do totval(i):= 0; for i:= 1 step 1 until 19 do for j:= 1 step 1 until 19 do begin ij:= 42*i+j*2; pq:= ij*4; fval:= 16384; for dir:= 0,1,2,3 do begin rs:= env(pq+dir); fval:= fval+envval.rs extract 12 end; totval(ij):= fval; totval(ij+1):= fval end i,j; i:= 1; comment writetotval(out,totval,env,envval,string playername(increase(i))); i:= 1; writeenvval(out,envval,string playername(increase(i))); i:= 1; disk(envval,-5,6560,string playername(increase(i)),0,1); i:= 1; disk(totval,0,1762,string playername(increase(i)),13,1) end ▶EOF◀