Another update from ingydotnet^djgoku

This commit is contained in:
Ingy döt Net 2015-11-18 06:14:39 +00:00
parent 91df62d461
commit 948b86eafa
7604 changed files with 108452 additions and 22726 deletions

View file

@ -0,0 +1,29 @@
* Find the missing permutation - 19/10/2015
PERMMISX CSECT
USING PERMMISX,R15 set base register
LA R4,0 i=0
LA R6,1 step
LA R7,23 to
LOOPI BXH R4,R6,ELOOPI do i=1 to hbound(perms)
LA R5,0 j=0
LA R8,1 step
LA R9,4 to
LOOPJ BXH R5,R8,ELOOPJ do j=1 to hbound(miss)
LR R1,R4 i
SLA R1,2 *4
LA R3,PERMS-5(R1) @perms(i)
AR R3,R5 j
LA R2,MISS-1(R5) @miss(j)
XC 0(1,R2),0(R3) miss(j)=miss(j) xor substr(perms(i),j,1)
B LOOPJ
ELOOPJ B LOOPI
ELOOPI XPRNT MISS,15 print buffer
XR R15,R15 set return code
BR R14 return to caller
PERMS DC C'ABCD',C'CABD',C'ACDB',C'DACB',C'BCDA',C'ACBD'
DC C'ADCB',C'CDAB',C'DABC',C'BCAD',C'CADB',C'CDBA'
DC C'CBAD',C'ABDC',C'ADBC',C'BDCA',C'DCBA',C'BACD'
DC C'BADC',C'BDAC',C'CBDA',C'DBCA',C'DCAB'
MISS DC 4XL1'00',C' is missing' buffer
YREGS
END PERMMISX