;redcode-94x verbose
;name Morbid Dread IV
;author Philip Thorne
;strategy   1-Shot scanner with decoy
;strategy   Submitted 01Dec02 1500
;kill Morbid Dread
;assert 1

START   EQU ((ptr-scan)-(STEP))
STEP    EQU (-2150) ;50
GAP     EQU 25
OFF     EQU 0

;quiz-based
zptr:   dat.f   clr,            (ptr-zptr)-MAXLENGTH
        dat     0,              0           ;weakend
        dat.f   <-15,           20
clr:    spl     #-2670,         30
        mov.i   @2,             >zptr
        mov.i   @1,             >zptr
        djn.b   -2,             {clr

    for 4
        dat     0,0
    rof

;find
scan:   add.f   incr,           ptr
ptr:    sne.i   scan+STEP+OFF,  scan+STEP+OFF+GAP
        djn.f   scan,           <ptr
        add.b   ptr,            zptr
        mov.i   clr,            *ptr
        mov.i   clr,            @ptr
        jmp     *0,             {0

    for MAXLENGTH-CURLINE-6
        dat         0,0
    rof

incr:   dat     #STEP,          #STEP+1
        dat     0,              0

;decoy out of HSA
tDecoy: EQU    (zptr+1641)
tStart: mov    <tDecoy+0,       {tDecoy+2     ; make a quick-decoy
        mov    <tDecoy+3,       {tDecoy+5     ; to foil one-shots
        mov    <tDecoy+6,       {tDecoy+8     ; and the occasional q-scan
tEnd:   djn.f  scan,            <tDecoy+10

    end tStart

;===
phil@linux:~/bench/94nop> koth q.red 8000 oct
q.red
pmars -b -r 8000  -F 700
- - - - - - - - - - - - - - -  W   L   T     Score
Candy.red                   : 1549 4843 1608      78
Puddleglum.red              : 2979 2721 2300     140
SonOfVain.red               : 1310 4823 1867      72
behemot.red                 : 2093 5381 526      85
crazyshot2.red              : 5833 2071  96     220
disincentive.red            : 4152 2571 1277     172
g2.red                      : 3736 4053 211     143
hazylazy.red                : 5296 2473 231     201
jaguar.red                  : 4628 1578 1794     196
nPaperII.red                : 3839 2224 1937     168
purifier.red                : 4257 2120 1623     180
recovery.red                : 5923 1464 613     230
reepicheep.red              : 3868 2376 1756     167
silvertalon12.red           : 1395 6279 326      56
twinshot.red                : 5198 2620 182     197
uninvited.red               : 1875 3868 2257      99
vanquisherII.red            : 2454 4883 663     100
velvetglove.red             : 929 2420 4651      93
wallpaper.red               : 3370 2640 1990     151
willow.red                  : 3286 4652  62     124
- - - - - - - - - - - - - - - - - - - - - - - - -
Total wins   =  67970
Total losses =  66060
Total ties   =  25970
Overall score is 143.675003